From b35d6aa16d9dae8350a36ac0256bf68a1ac51cef Mon Sep 17 00:00:00 2001 From: FormerLurker Date: Mon, 18 Jan 2021 11:14:41 -0600 Subject: Minor performance enhancements --- ArcWelder/unwritten_command.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'ArcWelder/unwritten_command.h') diff --git a/ArcWelder/unwritten_command.h b/ArcWelder/unwritten_command.h index 5c6f151..0bfea2d 100644 --- a/ArcWelder/unwritten_command.h +++ b/ArcWelder/unwritten_command.h @@ -35,7 +35,8 @@ struct unwritten_command } unwritten_command(parsed_command &cmd, bool is_relative, double command_length) { is_extruder_relative = is_relative; - command = cmd; + gcode = cmd.gcode; + comment = cmd.comment; extrusion_length = command_length; } unwritten_command(position* p, double command_length) { @@ -43,25 +44,24 @@ struct unwritten_command e_relative = p->get_current_extruder().e_relative; offset_e = p->get_current_extruder().get_offset_e(); is_extruder_relative = p->is_extruder_relative; - command = p->command; + gcode = p->command.gcode; + comment = p->command.comment; extrusion_length = command_length; } bool is_extruder_relative; double e_relative; double offset_e; double extrusion_length; - parsed_command command; + std::string gcode; + std::string comment; - std::string to_string(bool rewrite, std::string additional_comment) + std::string to_string() { - command.comment.append(additional_comment); - - if (rewrite) + if (comment.size() > 0) { - return command.rewrite_gcode_string(); + return gcode + ";" + comment; } - - return command.to_string(); + return gcode; } }; -- cgit v1.2.3