[squeak-dev] The Inbox: Chronology-Core-dtl.60.mcz

commits at source.squeak.org commits at source.squeak.org
Tue Sep 8 23:42:45 UTC 2020


A new version of Chronology-Core was added to project The Inbox:
http://source.squeak.org/inbox/Chronology-Core-dtl.60.mcz

==================== Summary ====================

Name: Chronology-Core-dtl.60
Author: dtl
Time: 8 September 2020, 7:42:44.062725 pm
UUID: afcc86c3-7fb2-4ecd-b9ae-9840f100393c
Ancestors: Chronology-Core-ul.58

Fix Time>>addSeconds: to maintain nanoseconds.

=============== Diff against Chronology-Core-ul.58 ===============

Item was changed:
  ----- Method: Time>>addSeconds: (in category 'smalltalk-80') -----
  addSeconds: nSeconds 
  	"Answer a Time that is nSeconds after the receiver."
  
+ 	| secondsToAdd newNanos |
+ 	(secondsToAdd := nSeconds truncated) = nSeconds
+ 		ifTrue: [newNanos := nanos]
+ 		ifFalse: [(newNanos := nanos + (nSeconds - secondsToAdd * NanosInSecond)) > NanosInSecond
+ 				ifTrue: [secondsToAdd := secondsToAdd + 1.
+ 					newNanos := newNanos - NanosInSecond]].
+ 	^ self class seconds: seconds + secondsToAdd nanoSeconds: newNanos!
- 	^ self class seconds: self asSeconds + nSeconds!



More information about the Squeak-dev mailing list