mercurial/lsprof.py
changeset 9325 74e717a21779
parent 9032 1fa80c5428b8
parent 9314 3f93f6838639
child 10339 23e608f42f2c
--- 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"""