Set.st
changeset 7654 41441d702cfc
parent 7598 27f37bd56675
child 8394 da194de43766
--- a/Set.st	Thu Oct 09 23:06:26 2003 +0200
+++ b/Set.st	Thu Oct 09 23:06:56 2003 +0200
@@ -679,16 +679,16 @@
     startIndex := index := self initialIndexForKey:key.
 
     [true] whileTrue:[
-	probe := (keyArray basicAt:index).
-	key = probe ifTrue:[^ index].
-	(self slotIsEmpty:probe) ifTrue:[^ aBlock value].
+        probe := (keyArray basicAt:index).
+        (probe notNil and:[key = probe]) ifTrue:[^ index].
+        (self slotIsEmpty:probe) ifTrue:[^ aBlock value].
 
-	index == length ifTrue:[
-	    index := 1
-	] ifFalse:[
-	    index := index + 1
-	].
-	index == startIndex ifTrue:[^ aBlock value].
+        index == length ifTrue:[
+            index := 1
+        ] ifFalse:[
+            index := index + 1
+        ].
+        index == startIndex ifTrue:[^ aBlock value].
     ]
 !
 
@@ -706,32 +706,32 @@
     startIndex := index := self initialIndexForKey:key.
 
     [true] whileTrue:[
-	probe := keyArray basicAt:index.
-	key = probe ifTrue:[^ index].
-	(self slotIsEmpty:probe) ifTrue:[
-	    delIndex isNil ifTrue:[^ index].
-	    keyArray basicAt:delIndex put:nil.
-	    ^ delIndex
-	].
+        probe := keyArray basicAt:index.
+        (probe notNil and:[key = probe]) ifTrue:[^ index].
+        (self slotIsEmpty:probe) ifTrue:[
+            delIndex isNil ifTrue:[^ index].
+            keyArray basicAt:delIndex put:nil.
+            ^ delIndex
+        ].
 
-	probe == DeletedEntry ifTrue:[
-	    delIndex isNil ifTrue:[
-		delIndex := index
-	    ]
-	].
+        probe == DeletedEntry ifTrue:[
+            delIndex isNil ifTrue:[
+                delIndex := index
+            ]
+        ].
 
-	index == length ifTrue:[
-	    index := 1
-	] ifFalse:[
-	    index := index + 1
-	].
-	index == startIndex ifTrue:[
-	    delIndex notNil ifTrue:[
-		keyArray basicAt:delIndex put:nil.
-		^ delIndex
-	    ].
-	    ^ self grow findKeyOrNil:key
-	].
+        index == length ifTrue:[
+            index := 1
+        ] ifFalse:[
+            index := index + 1
+        ].
+        index == startIndex ifTrue:[
+            delIndex notNil ifTrue:[
+                keyArray basicAt:delIndex put:nil.
+                ^ delIndex
+            ].
+            ^ self grow findKeyOrNil:key
+        ].
     ]
 
     "Modified: / 30.10.1997 / 16:01:57 / cg"
@@ -1101,7 +1101,7 @@
 !Set class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Set.st,v 1.87 2003-09-03 15:53:29 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Set.st,v 1.88 2003-10-09 21:06:56 cg Exp $'
 ! !
 
 Set initialize!