[prev in list] [next in list] [prev in thread] [next in thread] 

List:       zope3-checkins
Subject:    [Zope3-checkins] SVN: Zope3/trunk/src/bugtracker/browser/tracker.py
From:       Roger Ineichen <roger () projekt01 ! ch>
Date:       2006-05-31 10:41:17
Message-ID: 20060531104117.A700E2037FE () mail ! zope ! org
[Download RAW message or body]

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))
 

_______________________________________________
Zope3-Checkins mailing list
Zope3-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope3-checkins
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic