Commit 8a147d25 authored by Kai Willadsen's avatar Kai Willadsen

dirdiff: Improve float accuracy in timestamp resolution (bgo#753753)

The str() call was causing us to truncate nanosecond-accuracy digits,
but was only in place for Python 2.6 compatibility, which isn't a thing
we care about any more.
parent e3097906
......@@ -71,8 +71,8 @@ class StatItem(namedtuple('StatItem', 'mode size time')):
if abs(self.time - other.time) > 2:
return False
dectime1 = Decimal(str(self.time)).scaleb(Decimal(9)).quantize(1)
dectime2 = Decimal(str(other.time)).scaleb(Decimal(9)).quantize(1)
dectime1 = Decimal(self.time).scaleb(Decimal(9)).quantize(1)
dectime2 = Decimal(other.time).scaleb(Decimal(9)).quantize(1)
mtime1 = dectime1 // time_resolution_ns
mtime2 = dectime2 // time_resolution_ns
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment