From 060d2da7fe0eaef472da9adcc0aed1871026c86c Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Sun, 7 Apr 2013 18:01:15 -0400 Subject: [PATCH] Small optimization on an incredibly hot codepath. --- lib/Slic3r/Geometry.pm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/Slic3r/Geometry.pm b/lib/Slic3r/Geometry.pm index 0d2d9df4d7..dc30b3472b 100644 --- a/lib/Slic3r/Geometry.pm +++ b/lib/Slic3r/Geometry.pm @@ -116,8 +116,7 @@ sub distance_between_points { } sub comparable_distance_between_points { - my ($p1, $p2) = @_; - return (($p1->[X] - $p2->[X])**2) + (($p1->[Y] - $p2->[Y])**2); + return (($_[0]->[X] - $_[1]->[X])**2) + (($_[0]->[Y] - $_[1]->[Y])**2); } sub point_line_distance {