From e197fbaf5fe7a7fba8fabce73533725af9110d74 Mon Sep 17 00:00:00 2001 From: Gustavo Moreira Date: Wed, 30 Oct 2024 15:39:40 +1100 Subject: [PATCH] Linux: Boottime API: Refactor __sub__ to operate through __add__() and negate() for improved clarity and reuse --- .../framework/symbols/linux/extensions/__init__.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/volatility3/framework/symbols/linux/extensions/__init__.py b/volatility3/framework/symbols/linux/extensions/__init__.py index f20d93755..c80ffa515 100644 --- a/volatility3/framework/symbols/linux/extensions/__init__.py +++ b/volatility3/framework/symbols/linux/extensions/__init__.py @@ -2236,17 +2236,9 @@ class Timespec64Abstract(abc.ABC): if not isinstance(other, Timespec64Abstract): raise TypeError("Requires an object subclass of Timespec64Abstract") - # pylint: disable=E1101 - result = Timespec64Concrete( - tv_sec=self.tv_sec - other.tv_sec, - tv_nsec=self.tv_nsec - other.tv_nsec, - ) - - result.normalize() - return self + other.negate() - def negate(self): + def negate(self) -> "Timespec64Concrete": """Returns a new Timespec64Concrete object with the values of the current object negated""" # pylint: disable=E1101 result = Timespec64Concrete(