Optimization: Remove useless calls to union()

This commit is contained in:
Alessandro Ranellucci 2013-09-07 00:28:53 +02:00
parent 10ab3bbb86
commit 09684c67c2
2 changed files with 2 additions and 2 deletions

View File

@ -150,7 +150,7 @@ sub _merge_loops {
# of the loops, since the Orientation() function provided by Clipper # of the loops, since the Orientation() function provided by Clipper
# would do the same, thus repeating the calculation # would do the same, thus repeating the calculation
$slices = ($area[$i] >= 0) $slices = ($area[$i] >= 0)
? union([ $loops->[$i], @$slices ]) ? [ $loops->[$i], @$slices ]
: diff($slices, [$loops->[$i]]); : diff($slices, [$loops->[$i]]);
} }

View File

@ -654,7 +654,7 @@ sub discover_horizontal_shells {
offset($too_narrow, +$margin), offset($too_narrow, +$margin),
[ map $_->p, @neighbor_fill_surfaces ], [ map $_->p, @neighbor_fill_surfaces ],
)}; )};
$new_internal_solid = $solid = union([ @grown, @$new_internal_solid ]); $new_internal_solid = $solid = [ @grown, @$new_internal_solid ];
} else { } else {
# if we're printing a hollow object, we discard such small parts # if we're printing a hollow object, we discard such small parts
$new_internal_solid = $solid = diff( $new_internal_solid = $solid = diff(