Skip to content

Commit

Permalink
CQ: replace a loop by a list comprehension in gmodeler.canvas
Browse files Browse the repository at this point in the history
it brings performance improvement and more readable code
  • Loading branch information
pesekon2 committed Dec 7, 2024
1 parent f3405fe commit 272dde2
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions gui/wxpython/gmodeler/canvas.py
Original file line number Diff line number Diff line change
Expand Up @@ -440,12 +440,9 @@ def _onSelectShape(self, shape, append=False):
shape.Select(False, dc)
else:
shapeList = canvas.GetDiagram().GetShapeList()
toUnselect = []

if not append:
for s in shapeList:
if s.Selected():
toUnselect.append(s)
toUnselect = [s for s in shapeList if s.Selected()]

shape.Select(True, dc)

Expand Down

0 comments on commit 272dde2

Please sign in to comment.