diff mercurial/hgweb/webcommands.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 aa983c3d94a9
children 46293a0c7e9f
line wrap: on
line diff
--- a/mercurial/hgweb/webcommands.py	Sun Apr 26 16:50:44 2009 -0500
+++ b/mercurial/hgweb/webcommands.py	Sun Apr 26 16:50:44 2009 -0500
@@ -293,7 +293,7 @@
         raise ErrorResponse(HTTP_NOT_FOUND, 'path not found: ' + path)
 
     def filelist(**map):
-        for f in util.sort(files):
+        for f in sorted(files):
             full = files[f]
 
             fctx = ctx.filectx(full)
@@ -305,7 +305,7 @@
                    "permissions": mf.flags(full)}
 
     def dirlist(**map):
-        for d in util.sort(dirs):
+        for d in sorted(dirs):
 
             emptydirs = []
             h = dirs[d]
@@ -384,7 +384,7 @@
 
         b = web.repo.branchtags()
         l = [(-web.repo.changelog.rev(n), n, t) for t, n in b.iteritems()]
-        for r,n,t in util.sort(l):
+        for r,n,t in sorted(l):
             yield {'parity': parity.next(),
                    'branch': t,
                    'node': hex(n),