[meld/meld-3-14] dirdiff: Improve float accuracy in timestamp resolution (bgo#753753)



commit 06164e0dfcc8e2df81efa5dc40a19494e18307b2
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 01ac603..d34c95d 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]