Little improvement to get rid of an unneccesary copy operation.

Sat, 27 May 2017 18:17:03 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 27 May 2017 18:17:03 +0200
changeset 5743
630a68372016
parent 5742
dc9cd8059221
child 5744
d53474dcb9e6

Little improvement to get rid of an unneccesary copy operation.

UI/UserInterface.py file | annotate | diff | comparison | revisions
diff -r dc9cd8059221 -r 630a68372016 UI/UserInterface.py
--- a/UI/UserInterface.py	Sat May 20 16:13:23 2017 +0200
+++ b/UI/UserInterface.py	Sat May 27 18:17:03 2017 +0200
@@ -3628,11 +3628,8 @@
         """
         menu.clear()
         
-        tbList = []
-        for name, (text, tb) in list(self.__toolbars.items()):
-            tbList.append((text, tb, name))
-        
-        for text, tb, name in sorted(tbList, key=lambda t: t[0]):
+        for name, (text, tb) in sorted(self.__toolbars.items(),
+                                       key=lambda t: t[1][0]):
             act = menu.addAction(text)
             act.setCheckable(True)
             act.setChecked(not tb.isHidden())

eric ide

mercurial