Skip to content

Commit

Permalink
MultiLineTextWidget : Avoid linear-time signal methods
Browse files Browse the repository at this point in the history
We don't care exactly how many slots are connected, just if _any_ slot is connected. The latter is achievable in constant time while the former is linear in the number of slots.
  • Loading branch information
johnhaddon committed May 23, 2024
1 parent 65b0b6e commit 9c30a61
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion python/GafferUI/MultiLineTextWidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ def __paintActivationHint( self, painter ) :
return

widget = GafferUI.Widget._owner( self )
if widget is None or ( widget.activatedSignal().numSlots() + widget.editingFinishedSignal().numSlots() ) == 0 :
if widget is None or ( widget.activatedSignal().empty() and widget.editingFinishedSignal().empty() ) :
return

viewport = self.viewport()
Expand Down

0 comments on commit 9c30a61

Please sign in to comment.