IdentityDictionary.st
changeset 5050 ea292b958108
parent 2474 0103fbbe2659
child 6233 0a79cbd07543
--- a/IdentityDictionary.st	Thu Dec 02 12:22:55 1999 +0100
+++ b/IdentityDictionary.st	Thu Dec 02 12:23:41 1999 +0100
@@ -174,18 +174,18 @@
     "return true, if the argument, aValue is stored in the dictionary,
      Redefined to use identity compare, NOT equality compare"
 
-    ^ (valueArray identityIndexOf:aValue startingAt:1) ~~ 0
-
-    "Modified: 20.3.1997 / 15:59:27 / cg"
+    ^ self includesIdenticalValue:aValue
 !
 
 occurrencesOf:anObject
     "count & return how often anObject is stored in the dictionary.
      This counts values - not keys.
-     Redefined to use identity compare, NOT equality compare."
+     Redefined to use #== (identity compare), NOT equality compare."
 
     |cnt|
 
+    anObject isNil ifTrue:[^ super occurrencesOf:anObject].
+
     cnt := 0.
     valueArray do:[:element |
        element == anObject ifTrue:[cnt := cnt + 1]
@@ -196,5 +196,5 @@
 !IdentityDictionary class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/IdentityDictionary.st,v 1.26 1997-03-21 09:31:00 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/IdentityDictionary.st,v 1.27 1999-12-02 11:23:41 cg Exp $'
 ! !