Skip to content

Commit

Permalink
Windows Envars: Remove extra config check
Browse files Browse the repository at this point in the history
Tiny bit of cleanup here - there's no need to re-check the config for
`SILENT` for each variable. We can just initialize it once as either an
empty list or the calculated list of silent vars depending on the config
value.
  • Loading branch information
dgmcdona committed Feb 12, 2025
1 parent 8dceeb2 commit 4712caf
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions volatility3/framework/plugins/windows/envars.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,15 +200,13 @@ def _get_silent_vars(self) -> List[str]:
return values

def _generator(self, data):
silent_vars = []
if self.config.get("SILENT", None):
silent_vars = self._get_silent_vars()
silent_vars = self._get_silent_vars() if self.config.get("SILENT") else []

for task in data:
for var, val in task.environment_variables():
if self.config.get("silent", None):
if var in silent_vars:
continue
if var in silent_vars:
continue

yield (
0,
(
Expand Down

0 comments on commit 4712caf

Please sign in to comment.