[meld] dirdiff: Improve float accuracy in timestamp resolution (bgo#753753)
- From: Kai Willadsen <kaiw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [meld] dirdiff: Improve float accuracy in timestamp resolution (bgo#753753)
- Date: Fri, 21 Aug 2015 22:51:42 +0000 (UTC)
commit 8a147d25ed4da96ed6495498c4056743c11bbd5a
Author: Kai Willadsen <kai willadsen gmail com>
Date: Sat Aug 22 08:41:56 2015 +1000
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.
meld/dirdiff.py | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/meld/dirdiff.py b/meld/dirdiff.py
index 212dba7..e5db9ef 100644
--- a/meld/dirdiff.py
+++ b/meld/dirdiff.py
@@ -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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]