From 09684c67c2ac4e9e8b6977800eb6c34eb66dc15e Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Sat, 7 Sep 2013 00:28:53 +0200 Subject: [PATCH] Optimization: Remove useless calls to union() --- lib/Slic3r/Layer/Region.pm | 2 +- lib/Slic3r/Print/Object.pm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Slic3r/Layer/Region.pm b/lib/Slic3r/Layer/Region.pm index 75b62f486..3ce1603a1 100644 --- a/lib/Slic3r/Layer/Region.pm +++ b/lib/Slic3r/Layer/Region.pm @@ -150,7 +150,7 @@ sub _merge_loops { # of the loops, since the Orientation() function provided by Clipper # would do the same, thus repeating the calculation $slices = ($area[$i] >= 0) - ? union([ $loops->[$i], @$slices ]) + ? [ $loops->[$i], @$slices ] : diff($slices, [$loops->[$i]]); } diff --git a/lib/Slic3r/Print/Object.pm b/lib/Slic3r/Print/Object.pm index ca1560860..4493ee4a6 100644 --- a/lib/Slic3r/Print/Object.pm +++ b/lib/Slic3r/Print/Object.pm @@ -654,7 +654,7 @@ sub discover_horizontal_shells { offset($too_narrow, +$margin), [ map $_->p, @neighbor_fill_surfaces ], )}; - $new_internal_solid = $solid = union([ @grown, @$new_internal_solid ]); + $new_internal_solid = $solid = [ @grown, @$new_internal_solid ]; } else { # if we're printing a hollow object, we discard such small parts $new_internal_solid = $solid = diff(