IdentityDictionary.st
branchjv
changeset 20079 8d884971c2ed
parent 19559 d35a89d5c0ec
parent 20039 cd328445cac7
child 20131 4118d61ddba0
--- a/IdentityDictionary.st	Thu Jun 30 21:11:02 2016 +0100
+++ b/IdentityDictionary.st	Thu Jun 30 21:12:35 2016 +0100
@@ -1,3 +1,5 @@
+"{ Encoding: utf8 }"
+
 "
  COPYRIGHT (c) 1992 by Claus Gittinger
 	      All Rights Reserved
@@ -98,7 +100,7 @@
 
     [
         probe := keyArray basicAt:index.
-        probe == key ifTrue:[^ index].         "<<<< == is different from inherited"
+        probe == key ifTrue:[^ index].         "<--- == is different from inherited"
         probe isNil ifTrue:[^ aBlock value].
 
         index == length ifTrue:[
@@ -130,17 +132,15 @@
 
     [
         probe := keyArray basicAt:index.
-        key == probe ifTrue:[^ index].              "<<<< == is different from inherited"   
+        key == probe ifTrue:[^ index].              "<--- == is different from inherited"   
         probe isNil ifTrue:[
             delIndex == 0 ifTrue:[^ index].
             keyArray basicAt:delIndex put:nil.
             ^ delIndex
         ].
 
-        probe == DeletedEntry ifTrue:[
-            delIndex == 0 ifTrue:[
-                delIndex := index
-            ]
+        (delIndex == 0 and:[probe == DeletedEntry]) ifTrue:[
+            delIndex := index
         ].
 
         index == length ifTrue:[
@@ -153,7 +153,9 @@
                 keyArray basicAt:delIndex put:nil.
                 ^ delIndex
             ].
-            ^ self grow findKeyOrNil:key
+            self grow.
+            length := keyArray basicSize.
+            startIndex := index := self initialIndexForKey:key.
         ].
     ] loop.