Reduce indentation and complexity by using a pre-check

Contributes to issue CURA-7351.
This commit is contained in:
Ghostkeeper 2020-04-09 11:03:10 +02:00
parent cfc2cc3692
commit d9649dc3dd
No known key found for this signature in database
GPG key ID: D2A8871EE34EC59A

View file

@ -38,7 +38,8 @@ class RetractContinue(Script):
current_x = self.getValue(line, "X", current_x)
current_y = self.getValue(line, "Y", current_y)
if self.getValue(line, "G") == 1:
if self.getValue(line, "E"):
if not self.getValue(line, "E"): # Either None or 0: Not a retraction then.
continue
new_e = self.getValue(line, "E")
if new_e >= current_e: # Not a retraction.
continue