Skip to content

Commit 8b6e117

Browse files
clauder0ny123
authored andcommitted
perf(intel): use set.difference_update in FunctionCandidate.removeCallRefs
Follow-up to the call_ref_sources list-to-set switch: collapse the Python-level "for addr in source_addrs: discard()" loop into a single set.difference_update() call. The semantics are identical (both no-op on missing elements) but the work is now done in optimized C, which matters because removeCallRefs is called from FunctionCandidateManager.updateCandidates whenever HIGH_ACCURACY is on (the default) and conflicts are detected during CFG recovery. Validation: - pytest tests/test* -> 90 passed, 43 subtests passed - ruff check + format --check clean
1 parent ab0a332 commit 8b6e117

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

src/smda/intel/FunctionCandidate.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,7 @@ def addCallRef(self, source_addr):
8888
self._score = None
8989

9090
def removeCallRefs(self, source_addrs):
91-
for addr in source_addrs:
92-
self.call_ref_sources.discard(addr)
91+
self.call_ref_sources.difference_update(source_addrs)
9392
self._score = None
9493

9594
def setIsTailcallCandidate(self, is_tailcall):

0 commit comments

Comments
 (0)