Skip to content

Commit b0526d2

Browse files
committed
Refactor walk over code nodes using filter
Signed-off-by: John Pennycook <john.pennycook@intel.com>
1 parent 3663d02 commit b0526d2

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

codebasin/report.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -781,9 +781,10 @@ def files(
781781
setmap = defaultdict(int)
782782
if state:
783783
association = state.get_map(f)
784-
for node in [
785-
n for n in state.get_tree(f).walk() if isinstance(n, CodeNode)
786-
]:
784+
for node in filter(
785+
lambda x: isinstance(x, CodeNode),
786+
state.get_tree(f).walk(),
787+
):
787788
platform = frozenset(association[node])
788789
setmap[platform] += node.num_lines
789790
tree.insert(f, setmap)

0 commit comments

Comments
 (0)