--- a/IdentitySet.st Sat Dec 11 01:46:55 1993 +0100
+++ b/IdentitySet.st Sat Dec 11 01:59:35 1993 +0100
@@ -27,7 +27,7 @@
Since compare is on identity, hashing is also done via
identityHash instead of hash.
-$Header: /cvs/stx/stx/libbasic/IdentitySet.st,v 1.4 1993-11-08 02:30:42 claus Exp $
+$Header: /cvs/stx/stx/libbasic/IdentitySet.st,v 1.5 1993-12-11 00:49:32 claus Exp $
written jan 93 by claus
'!
@@ -43,19 +43,18 @@
|index "{ Class:SmallInteger }"
length startIndex probe |
- length := contentsArray basicSize.
+ length := keyArray basicSize.
length < 10 ifTrue:[
"assuming, that for small sets the overhead of hashing
- is large ... maybe that proves wrong (if overhead of comparing
- is high)"
- ^ contentsArray identityIndexOf:key ifAbsent:aBlock.
+ is large ..."
+ ^ keyArray identityIndexOf:key ifAbsent:aBlock.
].
startIndex := key identityHash \\ length + 1.
index := startIndex.
[true] whileTrue:[
- probe := (contentsArray basicAt:index).
+ probe := (keyArray basicAt:index).
probe == key ifTrue:[^ index].
probe isNil ifTrue:[^ aBlock value].
@@ -70,19 +69,19 @@
]
!
-findElementOrNil:key
+findKeyOrNil:key
"Look for the key in the receiver. Redefined to compare for
identity instead of equality"
|index "{ Class:SmallInteger }"
length startIndex probe |
- length := contentsArray basicSize.
+ length := keyArray basicSize.
startIndex := key identityHash \\ length + 1.
index := startIndex.
[true] whileTrue:[
- probe := contentsArray basicAt:index.
+ probe := keyArray basicAt:index.
(probe isNil or: [key == probe]) ifTrue:[^ index].
index == length ifTrue:[
@@ -103,10 +102,10 @@
|index "{ Class:SmallInteger }"
length|
- length := contentsArray basicSize.
+ length := keyArray basicSize.
index := key identityHash \\ length + 1.
- [(contentsArray basicAt:index) notNil] whileTrue:[
+ [(keyArray basicAt:index) notNil] whileTrue:[
index == length ifTrue:[
index := 1
] ifFalse:[