aboutsummaryrefslogtreecommitdiff
path: root/tools/find_bigfuncs.py
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-07-25 09:28:17 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-07-25 09:33:59 -0700
commitcf9f27864fc3bbf99adce808568e8cc691ee31b7 (patch)
treed5c8a08f1d9a50ebcb0f5b25b64625493ceeb1d1 /tools/find_bigfuncs.py
parent9aa1c31c714c959fe114191c92b22ea8c4f6d122 (diff)
fix find_bigfuncs.py
Diffstat (limited to 'tools/find_bigfuncs.py')
-rw-r--r--tools/find_bigfuncs.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/tools/find_bigfuncs.py b/tools/find_bigfuncs.py
index 31825544..6fdec3a9 100644
--- a/tools/find_bigfuncs.py
+++ b/tools/find_bigfuncs.py
@@ -7,16 +7,17 @@ import os, sys, re
filename = sys.argv[1]
i = 0
start = -1
-curr = '?'
+curr = None
data = []
for line in open(filename):
i += 1
if line.startswith('function '):
start = i
curr = line
- elif line.startswith('}'):
+ elif line.startswith('}') and curr:
size = i - start
- data.append([curr, size]);
+ data.append([curr, size])
+ curr = None
data.sort(lambda x, y: x[1] - y[1])
print ''.join(['%6d : %s' % (x[1], x[0]) for x in data])