The Trunk: Kernel-eem.1050.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: Kernel-eem.1050.mcz

commits-2
Eliot Miranda uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-eem.1050.mcz

==================== Summary ====================

Name: Kernel-eem.1050
Author: eem
Time: 3 December 2016, 9:32:37.361263 am
UUID: 57843650-49e3-4f32-a54b-026878128dc2
Ancestors: Kernel-cmm.1049

The various scanFor: and scanForEmptySlotFor: implementations only need to access the size of their array once.

=============== Diff against Kernel-cmm.1049 ===============

Item was changed:
  ----- Method: MethodDictionary>>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 identityHash \\ (size := array size) + 1.
- | index start |
- index := start := anObject identityHash \\ array size + 1.
  [
  | element |
  ((element := self basicAt: index) == nil or: [ element == anObject ])
  ifTrue: [ ^index ].
+ (index := index \\ size + 1) = start ] whileFalse.
- (index := index \\ array size + 1) = start ] whileFalse.
  self errorNoFreeSpace!