From 2fa52c89b34068223dc86234f76edf7de6af2bbf Mon Sep 17 00:00:00 2001 From: Stefan de Reuver <9864602+Horofic@users.noreply.github.com> Date: Thu, 2 Jan 2025 09:47:17 +0000 Subject: [PATCH] Create set comprehension --- dissect/target/plugins/os/windows/log/mssql.py | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/dissect/target/plugins/os/windows/log/mssql.py b/dissect/target/plugins/os/windows/log/mssql.py index 8ae5b1a7a..0ce1eaba3 100644 --- a/dissect/target/plugins/os/windows/log/mssql.py +++ b/dissect/target/plugins/os/windows/log/mssql.py @@ -90,13 +90,7 @@ def errorlog(self) -> Iterator[MssqlErrorlogRecord]: buf += line def _find_instances(self) -> set[str, TargetPath]: - instances = set() - - for subkey in self.target.registry.glob_ext(self.MSSQL_KEY_GLOB): - instances.add( - ( - subkey.name, - self.target.fs.path(subkey.subkey("SQLServerAgent").value("ErrorLogFile").value).parent, - ) - ) - return instances + return { + (subkey.name, self.target.fs.path(subkey.subkey("SQLServerAgent").value("ErrorLogFile").value).parent) + for subkey in self.target.registry.glob_ext(self.MSSQL_KEY_GLOB) + }