Skip to content

Commit e197fba

Browse files
committed
Linux: Boottime API: Refactor __sub__ to operate through __add__() and negate() for improved clarity and reuse
1 parent 7abe92c commit e197fba

File tree

1 file changed

+1
-9
lines changed
  • volatility3/framework/symbols/linux/extensions

1 file changed

+1
-9
lines changed

volatility3/framework/symbols/linux/extensions/__init__.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2236,17 +2236,9 @@ def __sub__(self, other) -> "Timespec64Concrete":
22362236
if not isinstance(other, Timespec64Abstract):
22372237
raise TypeError("Requires an object subclass of Timespec64Abstract")
22382238

2239-
# pylint: disable=E1101
2240-
result = Timespec64Concrete(
2241-
tv_sec=self.tv_sec - other.tv_sec,
2242-
tv_nsec=self.tv_nsec - other.tv_nsec,
2243-
)
2244-
2245-
result.normalize()
2246-
22472239
return self + other.negate()
22482240

2249-
def negate(self):
2241+
def negate(self) -> "Timespec64Concrete":
22502242
"""Returns a new Timespec64Concrete object with the values of the current object negated"""
22512243
# pylint: disable=E1101
22522244
result = Timespec64Concrete(

0 commit comments

Comments
 (0)