mirror of
https://github.com/volatilityfoundation/volatility3.git
synced 2026-10-16 21:25:14 +02:00
Merge pull request #2025 from Abyss-W4tcher/lazy_iteration_fix
Small optimization: Use "any" to avoid iterating the entire dataclasses.fields list
This commit is contained in:
@@ -79,7 +79,7 @@ class ObjectInformation:
|
||||
raise KeyError(f"No {key} present in ObjectInformation")
|
||||
|
||||
def __contains__(self, key):
|
||||
return key in [field.name for field in dataclasses.fields(self)]
|
||||
return any(field.name == key for field in dataclasses.fields(self))
|
||||
|
||||
|
||||
class ObjectInterface(metaclass=abc.ABCMeta):
|
||||
|
||||
Reference in New Issue
Block a user