Skip to content

Commit b607461

Browse files
committed
perf(common): drop discarded PeSymbolProvider.parseSymbols in getImportedFunctions
getImportedFunctions() instantiated PeSymbolProvider(None) and called parseSymbols(lief_result) only to throw the return value away, then spun up a second PeSymbolProvider(None) just to call parseImports. parseSymbols walks lief_binary.symbols and builds a function_symbols dict; with no `self` mutation (it returns the dict), that work is purely wasted whenever getImportedFunctions is called. This removes the dead call. parseSymbols still runs from getSymbols() and from PeSymbolProvider.update(), so symbol parsing is unchanged for the callers that actually use it. ELF path is untouched. Validation: - pytest tests/test* -> 111 passed, 79 subtests passed - ruff check + format --check clean
1 parent 8b6e117 commit b607461

1 file changed

Lines changed: 0 additions & 1 deletion

File tree

src/smda/common/BinaryInfo.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ def getImportedFunctions(self):
8080
if self.imported_functions is None:
8181
lief_result = self.getLiefBinary()
8282
if isinstance(lief_result, lief.PE.Binary):
83-
PeSymbolProvider(None).parseSymbols(lief_result)
8483
self.imported_functions = PeSymbolProvider(None).parseImports(lief_result)
8584
elif isinstance(lief_result, lief.ELF.Binary):
8685
self.imported_functions = ElfSymbolProvider(None).parseSymbols(lief_result.dynamic_symbols)

0 commit comments

Comments
 (0)