Mercurial > public > mercurial-scm > hg-stable
diff mercurial/copies.py @ 8209:a1a5a57efe90
replace util.sort with sorted built-in
This is marginally faster for small and moderately-sized lists
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Sun, 26 Apr 2009 16:50:44 -0500 |
parents | 08e1baf924ca |
children | 46293a0c7e9f |
line wrap: on
line diff
--- a/mercurial/copies.py Sun Apr 26 16:50:44 2009 -0500 +++ b/mercurial/copies.py Sun Apr 26 16:50:44 2009 -0500 @@ -10,7 +10,7 @@ def _nonoverlap(d1, d2, d3): "Return list of elements in d1 not in d2 or d3" - return util.sort([d for d in d1 if d not in d3 and d not in d2]) + return sorted([d for d in d1 if d not in d3 and d not in d2]) def _dirname(f): s = f.rfind("/") @@ -46,7 +46,7 @@ visit += [(p, depth - 1) for p in fc.parents()] # return old names sorted by depth - return [o[1] for o in util.sort(old.values())] + return [o[1] for o in sorted(old.values())] def _findlimit(repo, a, b): "find the earliest revision that's an ancestor of a or b but not both"