Skip to content

Commit b8ffac9

Browse files
committed
minor change
1 parent a90c8d4 commit b8ffac9

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

stumpy/cache.py

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -40,19 +40,17 @@ def get_njit_funcs():
4040
file_contents = f.read()
4141
module = ast.parse(file_contents)
4242
for node in module.body:
43-
if isinstance(node, ast.FunctionDef):
44-
func_name = node.name
45-
for decorator in node.decorator_list:
46-
scenario_1 = isinstance(decorator, ast.Name) and (
47-
decorator.id == "njit"
48-
)
49-
scenario_2 = (
50-
isinstance(decorator, ast.Call)
51-
and isinstance(decorator.func, ast.Name)
52-
and decorator.func.id == "njit"
53-
)
54-
if scenario_1 or scenario_2:
55-
njit_funcs.append((module_name, func_name))
43+
if not isinstance(node, ast.FunctionDef):
44+
continue
45+
46+
func_name = node.name
47+
for decorator in node.decorator_list:
48+
if (isinstance(decorator, ast.Name) and (decorator.id == "njit")) or (
49+
isinstance(decorator, ast.Call)
50+
and isinstance(decorator.func, ast.Name)
51+
and decorator.func.id == "njit"
52+
):
53+
njit_funcs.append((module_name, func_name))
5654

5755
return njit_funcs
5856

0 commit comments

Comments
 (0)