diff --git a/lib/Slic3r/Polyline.pm b/lib/Slic3r/Polyline.pm
index 6d257ff9f..2c3f9f88c 100644
--- a/lib/Slic3r/Polyline.pm
+++ b/lib/Slic3r/Polyline.pm
@@ -51,15 +51,7 @@ sub id {
 
 sub lines {
     my $self = shift;
-    my @lines = ();
-    my $previous_point;
-    foreach my $point (@$self) {
-        if ($previous_point) {
-            push @lines, Slic3r::Line->new($previous_point, $point);
-        }
-        $previous_point = $point;
-    }
-    return @lines;
+    return polyline_lines($self);
 }
 
 sub boost_linestring {