Commits

Yuya Nishihara committed e5bf497

graph: name function that prioritizes overlapped lines

Long lambda function is hard to read.

Comments (0)

Files changed (1)

tortoisehg/hgqt/repomodel.py

         else:
             def isactive(e):
                 return True
+        def lineimportance(pe):
+            return isactive(pe[1]), pe[1].importance
 
         for y1, y4, lines in ((dot_y, dot_y + h, gnode.bottomlines),
                               (dot_y - h, dot_y, gnode.toplines)):
             ymid = (y1 + y4)/2
             y3 = y1 + 3 * (y4 - y1)/4
 
-            lines = sorted(lines,
-                           key=lambda pe: (isactive(pe[1]), pe[1].importance))
+            lines = sorted(lines, key=lineimportance)
 
             for (start, end), e in lines:
                 active = isactive(e)