#REFACTORING by stefan
class: AbstractTime
changed:
#addMicroseconds:
#addMilliseconds:
constant folding (1000*1000*1000) works sub-optimal on 32-bit systems
--- a/AbstractTime.st Tue May 22 12:58:45 2018 +0200
+++ b/AbstractTime.st Tue May 22 17:04:38 2018 +0200
@@ -854,7 +854,7 @@
^ self speciesNew
setMilliseconds:(self getMilliseconds + (numberOfMicroSeconds // 1000))
additionalPicoseconds:(self additionalPicoseconds
- + ((numberOfMicroSeconds \\ 1000)*1000*1000) rounded)
+ + ((numberOfMicroSeconds \\ 1000)*1000000) truncated)
"
|t1 t2|
@@ -877,15 +877,17 @@
Transcript showCR:t.
Transcript showCR:(t addMilliseconds:1000).
"
+
+ "Modified: / 22-05-2018 / 16:52:37 / Stefan Vogel"
!
addMilliseconds:numberOfMilliSeconds
"return a new instance of myself, numberOfMilliSeconds afterwards."
^ self speciesNew
- setMilliseconds:(self getMilliseconds + (numberOfMilliSeconds // 1))
+ setMilliseconds:(self getMilliseconds + (numberOfMilliSeconds // 1 "this is inlined #truncated"))
additionalPicoseconds:(self additionalPicoseconds
- + ((numberOfMilliSeconds \\ 1)*1000*1000*1000) rounded)
+ + ((numberOfMilliSeconds \\ 1)*1000000000) truncated)
"
|t|
@@ -902,6 +904,8 @@
Transcript showCR:t.
Transcript showCR:(t addMilliseconds:1000).
"
+
+ "Modified: / 22-05-2018 / 17:03:20 / Stefan Vogel"
!
addMinutes:numberOfMinutes