--- a/SmallInteger.st Tue Dec 23 21:05:45 2014 +0100
+++ b/SmallInteger.st Tue Dec 23 21:07:04 2014 +0100
@@ -822,6 +822,7 @@
! !
+
!SmallInteger methodsFor:'bit operators'!
bitAnd:anInteger
@@ -2468,6 +2469,24 @@
^ self negated
!
+hashMultiply
+ "used in some squeak code to generate an alternative hash value for integers"
+
+ |low|
+
+ low := self bitAnd: 16r3FFF.
+ ^ (9741 * low
+ + ((9741 * (self bitShift: -14) + (101 * low) bitAnd: 16383) * 16384))
+ bitAnd: 16r0FFFFFFF
+
+ "
+ 1 hashMultiply
+ 2 hashMultiply
+ 3 hashMultiply
+ 100 hashMultiply
+ "
+!
+
identityHash
"return an integer useful for hashing on identity"
@@ -4543,11 +4562,11 @@
!SmallInteger class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic/SmallInteger.st,v 1.225 2014-11-11 14:24:34 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/SmallInteger.st,v 1.226 2014-12-23 20:07:04 cg Exp $'
!
version_CVS
- ^ '$Header: /cvs/stx/stx/libbasic/SmallInteger.st,v 1.225 2014-11-11 14:24:34 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/SmallInteger.st,v 1.226 2014-12-23 20:07:04 cg Exp $'
! !