The sort function has the inbuilt reversal option. We can use it to save some time.
Unified · Split
| @@ -80,8 +80,7 @@ def calc(oldfile, newfile, format): · 79 unmodified lines | ||
| 80 | 80 | if d<0: shrink, down = shrink+1, down-d |
| 81 | 81 | delta.append((d, name)) |
| 82 | 82 | |
| 83 | − delta.sort() | |
| 84 | − delta.reverse() | |
| 83 | + delta.sort(reverse=True) | |
| 85 | 84 | return grow, shrink, add, remove, up, down, delta, old, new, otot, ntot |
| 86 | 85 | |
| 87 | 86 | def print_result(symboltype, symbolformat): |