From bf6c517051248254c943af574488f9a05166fed4 Mon Sep 17 00:00:00 2001 From: lepelog <25211966+lepelog@users.noreply.github.com> Date: Mon, 4 Oct 2021 21:53:48 +0200 Subject: [PATCH] speedup tp.py progress --- tools/tp.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/tools/tp.py b/tools/tp.py index 58b21848cae..40f3ed94080 100644 --- a/tools/tp.py +++ b/tools/tp.py @@ -311,15 +311,9 @@ def find_function_ranges(asm_files): first = None last = None for line in file.readlines(): - line_start = line.find("/* ") - line_end = line.find(" */", 3) - - if line_start < 0 or line_end < 0: + if not line.startswith('/* '): continue - - line_values = line[line_start+3:line_end].split(" ") - assert len(line_values) == 6 - addr = int(line_values[0], 16) + addr = int(line[3:11], 16) if not first: first = addr last = addr + 4