From 1f0a1c3f2125171552eae608c3918862bb8834bb Mon Sep 17 00:00:00 2001 From: VolodymyrBg Date: Sun, 13 Jul 2025 15:11:34 +0300 Subject: [PATCH] Refactor type checking and opcode assignment in name_of_opcode --- scripts/perf/call_stack.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/scripts/perf/call_stack.py b/scripts/perf/call_stack.py index b54115550..2ab4017a9 100644 --- a/scripts/perf/call_stack.py +++ b/scripts/perf/call_stack.py @@ -6,14 +6,12 @@ def name_of_function(itable:dict, func_index): return itable[func_index][0]["function_name"] def name_of_opcode(opcode): - if not type(opcode) == str: + if not isinstance(opcode, str): if len(opcode.items()) != 1: print("Panic") exit(1) - for key, value in opcode.items(): - opcode = key - break + opcode = list(opcode.keys())[0] return opcode