Commits

Yuya Nishihara committed 57f7019

manifest: remove extra branching and string concatenation in sort()

Comments (0)

Files changed (1)

tortoisehg/hgqt/manifestmodel.py

         for e in self._child.itervalues():
             e.sort(reverse=reverse)
         self._nameindex.sort(
-            key=lambda s: '%s%s' % (self[s] and 'D' or 'F', os.path.normcase(s)),
+            key=lambda s: (not self[s], os.path.normcase(s)),
             reverse=reverse)
 
 class ManifestCompleter(QCompleter):