process: simplify string enumeration loop

This commit is contained in:
Willi Ballenthin
2023-08-10 11:38:43 +02:00
committed by GitHub
parent ae9d773e04
commit 85b58d041b

View File

@@ -44,9 +44,8 @@ def extract_environ_strings(behavior: Dict, ph: ProcessHandle) -> Iterator[Tuple
if not environ:
return
for _, value in environ.items():
if value:
yield String(value), ph.address
for value in (value for value in environ.values() if value):
yield String(value), ph.address
def extract_features(behavior: Dict, ph: ProcessHandle) -> Iterator[Tuple[Feature, Address]]: