[Zope3-checkins] SVN: Zope3/trunk/src/bugtracker/browser/tracker.py Changed:

Roger Ineichen roger at projekt01.ch
Wed May 31 06:41:17 EDT 2006


Log message for revision 68408:
  Changed:
  Instead of using:
     sorted(items, lambda x, y: cmp(int(x[0]), int(y[0]))) 
  you should use the much faster:
     sorted(items, key=lambda x: int(x[0]))
  
  Thanks Florent

Changed:
  U   Zope3/trunk/src/bugtracker/browser/tracker.py

-=-
Modified: Zope3/trunk/src/bugtracker/browser/tracker.py
===================================================================
--- Zope3/trunk/src/bugtracker/browser/tracker.py	2006-05-31 10:36:50 UTC (rev 68407)
+++ Zope3/trunk/src/bugtracker/browser/tracker.py	2006-05-31 10:41:17 UTC (rev 68408)
@@ -207,7 +207,7 @@
         formatter = self.request.locale.dates.getFormatter('dateTime', 'short')
         result = []
         items  = self.context.items()
-        for name, bug in sorted(items, lambda x, y: cmp(int(x[0]), int(y[0]))):
+        for name, bug in sorted(items, key=lambda x: int(x[0])):
             if checkBug(bug, criteria, self.getSearchText()):
                 result.append(BugView(bug, self.request))
 



More information about the Zope3-Checkins mailing list