diff options
author | FormerLurker <hochgebe@gmail.com> | 2021-01-18 20:14:41 +0300 |
---|---|---|
committer | FormerLurker <hochgebe@gmail.com> | 2021-01-18 20:14:41 +0300 |
commit | b35d6aa16d9dae8350a36ac0256bf68a1ac51cef (patch) | |
tree | f46bdf33c00d59c8c1de76f76a6ccab005fdba9b /ArcWelder/unwritten_command.h | |
parent | 4d7375393fa603d3a2b14425a9c269ca521823ee (diff) |
Minor performance enhancements
Diffstat (limited to 'ArcWelder/unwritten_command.h')
-rw-r--r-- | ArcWelder/unwritten_command.h | 20 |
1 files changed, 10 insertions, 10 deletions
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; } }; |