Andreas Raab uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-ul.230.mcz==================== Summary ====================
Name: Collections-ul.230
Author: ul
Time: 1 December 2009, 4:32:14 am
UUID: 9130582b-780e-8f4d-9daa-ca90b6b15da3
Ancestors: Collections-ul.229
Part 1 of KeyedIdentitySet hash change.
Also removed previous preamble.
=============== Diff against Collections-ul.229 ===============
Item was changed:
----- Method: KeyedIdentitySet>>scanForEmptySlotFor: (in category 'private') -----
scanForEmptySlotFor: anObject
"Scan the key array for the first slot containing an empty slot (indicated by a nil). Answer the index of that slot. This method will be overridden in various subclasses that have different interpretations for matching elements."
+ | index start |
+ index := start := anObject scaledIdentityHash \\ array size + 1.
- | index start hash |
- array size >= 8192
- ifTrue: [ hash := anObject identityHash * (array size // 4096) ]
- ifFalse: [ hash := anObject identityHash ].
- index := start := hash \\ array size + 1.
[
(array at: index) ifNil: [ ^index ].
(index := index \\ array size + 1) = start ] whileFalse.
self errorNoFreeSpace!
Item was changed:
Item was changed:
----- Method: KeyedIdentitySet>>scanFor: (in category 'private') -----
scanFor: anObject
"Scan the key array for the first slot containing either a nil (indicating an empty slot) or an element that matches anObject. Answer the index of that slot or raise an error if no slot is found. This method will be overridden in various subclasses that have different interpretations for matching elements."
+ | index start |
+ CollectionRehashingUtility quickRehashBecause: #keyedIdentitySetScanForChanged.
+ index := start := anObject scaledIdentityHash \\ array size + 1.
- | index start hash |
- array size >= 8192
- ifTrue: [ hash := anObject identityHash * (array size // 4096) ]
- ifFalse: [ hash := anObject identityHash ].
- index := start := hash \\ array size + 1.
[
| element |
((element := array at: index) == nil or: [ (keyBlock value: element) == anObject ])
ifTrue: [ ^index ].
(index := index \\ array size + 1) = start ] whileFalse.
self errorNoFreeSpace!