diff mercurial/lsprof.py @ 9325:74e717a21779

Merge with mpm
author Bryan O'Sullivan <bos@serpentine.com>
date Thu, 06 Aug 2009 18:48:00 -0700
parents 1fa80c5428b8 3f93f6838639
children 23e608f42f2c
line wrap: on
line diff
--- a/mercurial/lsprof.py	Wed Aug 05 17:19:37 2009 +0200
+++ b/mercurial/lsprof.py	Thu Aug 06 18:48:00 2009 -0700
@@ -26,12 +26,10 @@
         """XXX docstring"""
         if crit not in profiler_entry.__dict__:
             raise ValueError("Can't sort by %s" % crit)
-        self.data.sort(lambda b, a: cmp(getattr(a, crit),
-                                        getattr(b, crit)))
+        self.data.sort(key=lambda x: getattr(x, crit), reverse=True)
         for e in self.data:
             if e.calls:
-                e.calls.sort(lambda b, a: cmp(getattr(a, crit),
-                                              getattr(b, crit)))
+                e.calls.sort(key=lambda x: getattr(x, crit), reverse=True)
 
     def pprint(self, top=None, file=None, limit=None, climit=None):
         """XXX docstring"""