[squeak-dev] The Trunk: Kernel-ul.604.mcz
siguctua at gmail.com
Mon Jul 11 11:30:26 UTC 2011
Levente, your change is a bit dangerous,
because if i remember correctly, not all primitives normalizing large integers.
So, it is fairly possible to have large integer with value in a range
of small integer.
Not saying , that one can manipulate largeinteger bits directly, and
then use it later in comparison,
which will fail due to your changes.
So, such change requiring strong guarantees that you cannot create
large integers which is in range of small integers.
On 10 July 2011 16:36, <commits at source.squeak.org> wrote:
> Levente Uzonyi uploaded a new version of Kernel to project The Trunk:
> ==================== Summary ====================
> Name: Kernel-ul.604
> Author: ul
> Time: 10 July 2011, 4:36:20.467 pm
> UUID: f758876f-a507-404b-aa2f-2c1038504b48
> Ancestors: Kernel-bf.603
> Optimized Integer >> #= for integer-integer comparisons. Return false for integers from different classes without further checking.
> =============== Diff against Kernel-bf.603 ===============
> Item was changed:
> ----- Method: Integer>>= (in category 'comparing') -----
> = aNumber
> + aNumber isInteger ifTrue: [
> + aNumber class == self class ifFalse: [ ^false ].
> + ^(self digitCompare: aNumber) = 0 ].
> + aNumber isNumber ifFalse: [ ^false ].
> + ^aNumber adaptToInteger: self andCompare: #=!
> - aNumber isNumber ifFalse: [^ false].
> - aNumber isInteger ifTrue:
> - [aNumber negative == self negative
> - ifTrue: [^ (self digitCompare: aNumber) = 0]
> - ifFalse: [^ false]].
> - ^ aNumber adaptToInteger: self andCompare: #=!
Igor Stasenko AKA sig.
More information about the Squeak-dev