Eliot Miranda uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-eem.920.mcz==================== Summary ====================
Name: System-eem.920
Author: eem
Time: 3 December 2016, 9:33:47.096323 am
UUID: 694cd18b-4572-4762-b5b9-29e116119a9d
Ancestors: System-bf.919
The various scanFor: and scanForEmptySlotFor: implementations only need to access the size of their array once.
=============== Diff against System-bf.919 ===============
Item was changed:
----- Method: SystemDictionary>>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 size |
+ index := start := anObject hash \\ (size := array size) + 1.
- | index start |
- index := start := anObject hash \\ array size + 1.
[
| element |
((element := array at: index) == nil or: [ element key == anObject ])
ifTrue: [ ^index ].
+ (index := index \\ size + 1) = start ] whileFalse.
- (index := index \\ array size + 1) = start ] whileFalse.
self errorNoFreeSpace!
Item was changed:
----- Method: SystemDictionary>>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 size |
+ index := start := anObject hash \\ (size := array size) + 1.
- | index start |
- index := start := anObject hash \\ array size + 1.
[
(array at: index) ifNil: [ ^index ].
+ (index := index \\ size + 1) = start ] whileFalse.
- (index := index \\ array size + 1) = start ] whileFalse.
self errorNoFreeSpace!