mirror of
https://github.com/volatilityfoundation/volatility3.git
synced 2026-09-08 18:57:38 +02:00
Linux: Boottime API: Minor. Move negate() up
This commit is contained in:
@@ -2244,6 +2244,18 @@ class Timespec64Abstract(abc.ABC):
|
||||
|
||||
result.normalize()
|
||||
|
||||
return self + other.negate()
|
||||
|
||||
def negate(self):
|
||||
"""Returns a new Timespec64Concrete object with the values of the current object negated"""
|
||||
# pylint: disable=E1101
|
||||
result = Timespec64Concrete(
|
||||
tv_sec=-self.tv_sec,
|
||||
tv_nsec=-self.tv_nsec,
|
||||
)
|
||||
|
||||
result.normalize()
|
||||
|
||||
return result
|
||||
|
||||
def normalize(self):
|
||||
@@ -2259,18 +2271,6 @@ class Timespec64Abstract(abc.ABC):
|
||||
self.tv_nsec += NSEC_PER_SEC
|
||||
self.tv_sec -= 1
|
||||
|
||||
def negate(self):
|
||||
"""Returns a new Timespec64Concrete object with the values of the current object negated"""
|
||||
# pylint: disable=E1101
|
||||
result = Timespec64Concrete(
|
||||
tv_sec=-self.tv_sec,
|
||||
tv_nsec=-self.tv_nsec,
|
||||
)
|
||||
|
||||
result.normalize()
|
||||
|
||||
return result
|
||||
|
||||
|
||||
class Timespec64Concrete(Timespec64Abstract):
|
||||
"""Handle all required timespec64 operations, convertions and adjustments.
|
||||
|
||||
Reference in New Issue
Block a user