mercurial/lsprof.py
changeset 7008 8fee8ff13d37
parent 6212 e75aab656f46
child 7622 4dd7b28003d2
equal deleted inserted replaced
7007:a6b74fbb5ce0 7008:8fee8ff13d37
    23         self.data = data
    23         self.data = data
    24 
    24 
    25     def sort(self, crit="inlinetime"):
    25     def sort(self, crit="inlinetime"):
    26         """XXX docstring"""
    26         """XXX docstring"""
    27         if crit not in profiler_entry.__dict__:
    27         if crit not in profiler_entry.__dict__:
    28             raise ValueError, "Can't sort by %s" % crit
    28             raise ValueError("Can't sort by %s" % crit)
    29         self.data.sort(lambda b, a: cmp(getattr(a, crit),
    29         self.data.sort(lambda b, a: cmp(getattr(a, crit),
    30                                         getattr(b, crit)))
    30                                         getattr(b, crit)))
    31         for e in self.data:
    31         for e in self.data:
    32             if e.calls:
    32             if e.calls:
    33                 e.calls.sort(lambda b, a: cmp(getattr(a, crit),
    33                 e.calls.sort(lambda b, a: cmp(getattr(a, crit),