mirror of
https://github.com/volatilityfoundation/volatility3.git
synced 2026-09-13 13:17:38 +02:00
Linux: Boottime API: Refactor __sub__ to operate through __add__() and negate() for improved clarity and reuse
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user