Skip to content

Commit 47f4d76

Browse files
Update codeflash/code_utils/deduplicate_code.py
Co-authored-by: codeflash-ai[bot] <148906541+codeflash-ai[bot]@users.noreply.github.com>
1 parent a831ee3 commit 47f4d76

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

codeflash/code_utils/deduplicate_code.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ def visit_ImportFrom(self, node):
6666

6767
def visit_Global(self, node):
6868
"""Track global variable declarations"""
69-
for name in node.names:
70-
self.global_vars.add(name)
69+
# Avoid repeated .add calls by using set.update with list
70+
self.global_vars.update(node.names)
7171
return node
7272

7373
def visit_Nonlocal(self, node):

0 commit comments

Comments
 (0)