summaryrefslogtreecommitdiff
path: root/z80count.py
diff options
context:
space:
mode:
authorJuan J. Martinez <jjm@usebox.net>2019-03-21 20:23:18 +0000
committerJuan J. Martinez <jjm@usebox.net>2019-03-21 20:23:18 +0000
commit00941888e7bd33a15c345aaf9e72eb9223e4c75f (patch)
tree166a0230c8ed6b7772e7cb95f66e203eb0e3a3d8 /z80count.py
parent9f2aaef291e60b83d153d3a9abd4ce22ff59c997 (diff)
downloadz80count-00941888e7bd33a15c345aaf9e72eb9223e4c75f.tar.gz
z80count-00941888e7bd33a15c345aaf9e72eb9223e4c75f.zip
Sort the table once
Diffstat (limited to 'z80count.py')
-rwxr-xr-xz80count.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/z80count.py b/z80count.py
index 503736e..58c07f1 100755
--- a/z80count.py
+++ b/z80count.py
@@ -65,6 +65,7 @@ def main():
our_comment = re.compile(r"(\[[0-9.\s/]+\])")
+ table = sorted(table, key=lambda o: o["w"])
total = total_cond = 0
while True:
line = in_f.readline()
@@ -72,7 +73,7 @@ def main():
break
found = False
- for entry in sorted(table, key=lambda o: o["w"]):
+ for entry in table:
if entry["cregex"].search(line):
cycles = entry["cycles"]
if "/" in cycles: