Skip to content

Commit

Permalink
CQ: optimise if conditions in gmodeler.canvas (#4813)
Browse files Browse the repository at this point in the history
no need to run the same if condition twice when one of the interluding one could be inserted in
  • Loading branch information
pesekon2 authored Dec 7, 2024
1 parent 1c256f9 commit 2ae6362
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions gui/wxpython/gmodeler/canvas.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,10 +329,10 @@ def OnRightClick(self, x, y, keys=0, attachment=0):
self.frame.Bind(wx.EVT_MENU, self.OnEnable, id=self.popupID["enable"])
if isinstance(shape, (ModelAction, ModelComment)):
popupMenu.AppendSeparator()
if isinstance(shape, ModelAction):
popupMenu.Append(self.popupID["label"], _("Set label"))
self.frame.Bind(wx.EVT_MENU, self.OnSetLabel, id=self.popupID["label"])
if isinstance(shape, (ModelAction, ModelComment)):
if isinstance(shape, ModelAction):
popupMenu.Append(self.popupID["label"], _("Set label"))
self.frame.Bind(wx.EVT_MENU, self.OnSetLabel, id=self.popupID["label"])

popupMenu.Append(self.popupID["comment"], _("Set comment"))
self.frame.Bind(wx.EVT_MENU, self.OnSetComment, id=self.popupID["comment"])

Expand Down

0 comments on commit 2ae6362

Please sign in to comment.