From f56206cac3e965350327240df4cb98ad1f4373af Mon Sep 17 00:00:00 2001 From: "Y. Sapir" Date: Sun, 30 Mar 2014 14:34:00 +0300 Subject: [PATCH] Precache gcode_comments flag before path loop. --- lib/Slic3r/GCode.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Slic3r/GCode.pm b/lib/Slic3r/GCode.pm index 1be05ffbe..d93117a86 100644 --- a/lib/Slic3r/GCode.pm +++ b/lib/Slic3r/GCode.pm @@ -340,6 +340,7 @@ sub extrude_path { # extrude arc or line $gcode .= ";_BRIDGE_FAN_START\n" if $path->is_bridge; + my $gcode_comments = $self->print_config->gcode_comments; my $path_length = 0; { my $local_F = $F; @@ -362,7 +363,7 @@ sub extrude_path { $gcode .= " F$local_F" if $local_F; $gcode .= " ; $description" - if $self->print_config->gcode_comments; + if $gcode_comments; $gcode .= "\n"; # only include F in the first line