DateAndTime hash was: Re: [squeak-dev] true hash
Nicolas Cellier
nicolas.cellier.aka.nice at gmail.com
Thu May 10 21:18:55 UTC 2012
Maybe something like this
hash
| totalSeconds |
totalSeconds := seconds - offset asSeconds.
^ ((totalSeconds // 86400 + jdn) hashMultiply bitXor: totalSeconds \\
86400) bitXor: nanos
Nicolas
2012/5/10 Nicolas Cellier <nicolas.cellier.aka.nice at gmail.com>:
> Sorry to duplicate but it breaks this test
>
> | date1 date2 |
> date1 := DateAndTime new ticks: (DateAndTime unixEpoch + 1 hours)
> ticks offset: 0 hours.
> date2 := DateAndTime new ticks: (DateAndTime unixEpoch - 2 hours)
> ticks offset: -3 hours.
> self assert: (date1 = date2) ==> [date1 hash = date2 hash]
>
> 2012/5/10 Paul DeBruicker <pdebruic at gmail.com>:
>> On 05/10/2012 10:05 AM, Eliot Miranda wrote:
>>>
>>> Just doit. Make that change. If you don't have commit rights, commit
>>> it to inbox. please!
>>
>>
>>
>> I don't have rights and did save the changes to the inbox as:
>>
>> Kernel-pad.663.mcz
>>
More information about the Squeak-dev
mailing list
|