#BUGFIX by cg
authorClaus Gittinger <cg@exept.de>
Sun, 26 May 2019 11:37:39 +0200
changeset 24159 f3f05b723a29
parent 24158 fb63564d89d8
child 24160 93d4db241317
#BUGFIX by cg class: TimeDuration FIX: did not care for picos, when comparing. added: #< #= #hash
TimeDuration.st
--- a/TimeDuration.st	Sun May 26 11:05:58 2019 +0200
+++ b/TimeDuration.st	Sun May 26 11:37:39 2019 +0200
@@ -895,6 +895,39 @@
     "Created: / 15-03-2019 / 17:57:50 / Stefan Vogel"
 ! !
 
+!TimeDuration methodsFor:'comparing'!
+
+< something
+    |otherTimeEncoding|
+    
+    something class == self class ifTrue:[
+        otherTimeEncoding :=something timeEncoding.
+        timeEncoding = otherTimeEncoding ifTrue:[
+            ^ (additionalPicoseconds ? 0) < something additionalPicoseconds
+        ].    
+        ^ timeEncoding < otherTimeEncoding
+    ].    
+    ^ super < something
+
+    "Created: / 26-05-2019 / 10:02:59 / Claus Gittinger"
+!
+
+= something
+    something class == self class ifTrue:[
+        ^ timeEncoding = something timeEncoding
+        and:[(additionalPicoseconds ? 0) = something additionalPicoseconds]
+    ].    
+    ^ super = something
+
+    "Created: / 26-05-2019 / 09:40:44 / Claus Gittinger"
+!
+
+hash
+    ^ timeEncoding bitXor:(additionalPicoseconds ? 0)
+
+    "Created: / 26-05-2019 / 09:45:19 / Claus Gittinger"
+! !
+
 !TimeDuration methodsFor:'converting'!
 
 asExactHours
@@ -1613,6 +1646,7 @@
     "Modified: / 27-07-2018 / 10:30:13 / Stefan Vogel"
 ! !
 
+
 !TimeDuration methodsFor:'printing'!
 
 addPrintBindingsTo:aDictionary language:languageOrNil