From 00941888e7bd33a15c345aaf9e72eb9223e4c75f Mon Sep 17 00:00:00 2001 From: "Juan J. Martinez" Date: Thu, 21 Mar 2019 20:23:18 +0000 Subject: Sort the table once --- z80count.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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: -- cgit v1.2.3