History

scripts/bloat-o-meter: use the reverse flag for sort

The sort function has the inbuilt reversal option. We can use it to save some time.

Alexander Pantyukhin committed 3 years ago

Commit 0371ba61 parent e36903b1 file · +1 −2Browse files

Unified · Split

scripts/bloat-o-meter+1−2
@@ -80,8 +80,7 @@ def calc(oldfile, newfile, format): · 79 unmodified lines
80 if d<0: shrink, down = shrink+1, down-d80 if d<0: shrink, down = shrink+1, down-d
81 delta.append((d, name))81 delta.append((d, name))
82 82
83 delta.sort()83 delta.sort(reverse=True)
84 delta.reverse()
85 return grow, shrink, add, remove, up, down, delta, old, new, otot, ntot84 return grow, shrink, add, remove, up, down, delta, old, new, otot, ntot
86 85
87def print_result(symboltype, symbolformat):86def print_result(symboltype, symbolformat):

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t