Skip to content

Commit

Permalink
CQ: replace a loop by a list comprehension in gmodeler.canvas (#4814)
Browse files Browse the repository at this point in the history
it brings performance improvement and more readable code
  • Loading branch information
pesekon2 authored Dec 7, 2024
1 parent 8b5c6f9 commit 1c256f9
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions gui/wxpython/gmodeler/canvas.py
Original file line number Diff line number Diff line change
Expand Up @@ -440,12 +440,8 @@ 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()] if not append else []

shape.Select(True, dc)

Expand Down

0 comments on commit 1c256f9

Please sign in to comment.