The Trunk: Chronology-Core-nice.52.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: Chronology-Core-nice.52.mcz

commits-2
Nicolas Cellier uploaded a new version of Chronology-Core to project The Trunk:
http://source.squeak.org/trunk/Chronology-Core-nice.52.mcz

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

Name: Chronology-Core-nice.52
Author: nice
Time: 12 March 2020, 12:03:38.8371 pm
UUID: eb71ab74-c271-4a0e-bf81-ef3b0917ce67
Ancestors: Chronology-Core-mt.51

Normalize a copy of jdn,seconds,nanos so as to prevent attempts to modify a read-only literal.

=============== Diff against Chronology-Core-mt.51 ===============

Item was changed:
  ----- Method: DateAndTime>>ticks:offset: (in category 'private') -----
  ticks: ticks offset: utcOffset
  "ticks is {julianDayNumber. secondCount. nanoSeconds}"
 
+ | jdn s nanos normalizedTicks |
+ normalizedTicks := ticks copy.
+ self normalize: 3 ticks: normalizedTicks base: NanosInSecond.
+ self normalize: 2 ticks: normalizedTicks base: SecondsInDay.
- | jdn s nanos |
- self normalize: 3 ticks: ticks base: NanosInSecond.
- self normalize: 2 ticks: ticks base: SecondsInDay.
 
+ jdn := normalizedTicks at: 1.
+ s := normalizedTicks at: 2.
+ nanos := normalizedTicks at: 3.
- jdn := ticks at: 1.
- s := ticks at: 2.
- nanos := ticks at: 3.
  localOffsetSeconds := utcOffset ifNil: [0] ifNotNil: [utcOffset asSeconds].
  utcMicroseconds := self microsecondsFromDay: jdn seconds: s nanos: nanos offset: localOffsetSeconds.
  !