'From Squeak3.8alpha of ''17 July 2004'' [latest update: #5976] on 28 July 2004 at 4:26:35 pm'! "Change Set: fastDateAndTimeEquals-brp Date: 28 July 2004 Author: Brent Pinkney This changeset provides a 60% improvement in performance when comparing DateAndTime instances."! !DateAndTime methodsFor: 'ansi protocol' stamp: 'brp 7/28/2004 16:14'! = comparand "comparand conforms to protocol DateAndTime, or can be converted into something that conforms." | comparandAsDateAndTime | self == comparand ifTrue: [^ true]. [comparandAsDateAndTime := comparand asDateAndTime] on: MessageNotUnderstood do: [^ false]. ^ self offset = comparandAsDateAndTime offset ifTrue: [self hasEqualTicks: comparandAsDateAndTime ] ifFalse: [self asUTC ticks = comparandAsDateAndTime asUTC ticks] ! ! !DateAndTime methodsFor: 'private' stamp: 'brp 7/28/2004 16:22'! hasEqualTicks: aDateAndTime ^ (jdn = aDateAndTime julianDayNumber) and: [ (seconds = aDateAndTime secondsSinceMidnight) and: [ nanos = aDateAndTime nanoSecond ] ] ! ! !DateAndTime methodsFor: 'private' stamp: 'brp 7/28/2004 16:20'! secondsSinceMidnight ^ seconds! !