From f018b1dedbc88af7070b3880ccdae8019ec67680 Mon Sep 17 00:00:00 2001 From: Chris Hennes Date: Sun, 28 Feb 2021 23:11:52 -0600 Subject: [PATCH] [DRAFT] Remove unused loop variable LGTM is concerned about the unused loop variable in this algorithm. While there was nothing wrong here, to eliminate the alarm the loop was removed entirely, since Python allows the use of the multiplication operator here to achieve the same effect. --- src/Mod/Draft/draftguitools/gui_trimex.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Mod/Draft/draftguitools/gui_trimex.py b/src/Mod/Draft/draftguitools/gui_trimex.py index 88546b0716..47b449d641 100644 --- a/src/Mod/Draft/draftguitools/gui_trimex.py +++ b/src/Mod/Draft/draftguitools/gui_trimex.py @@ -120,8 +120,7 @@ class Trimex(gui_base_original.Modifier): self.extrudeMode = True self.ghost = [trackers.ghostTracker([self.obj])] self.normal = self.obj.Shape.Faces[0].normalAt(0.5, 0.5) - for v in self.obj.Shape.Vertexes: - self.ghost.append(trackers.lineTracker()) + self.ghost += [trackers.lineTracker()] * len(self.obj.Shape.Vertexes) elif len(self.obj.Shape.Faces) > 1: # face extrude mode, a new object is created ss = Gui.Selection.getSelectionEx()[0] @@ -132,8 +131,7 @@ class Trimex(gui_base_original.Modifier): self.extrudeMode = True self.ghost = [trackers.ghostTracker([self.obj])] self.normal = self.obj.Shape.Faces[0].normalAt(0.5, 0.5) - for v in self.obj.Shape.Vertexes: - self.ghost.append(trackers.lineTracker()) + self.ghost += [trackers.lineTracker()] * len(self.obj.Shape.Vertexes) else: # normal wire trimex mode self.color = self.obj.ViewObject.LineColor