Set.st
branchjv
changeset 19882 8a3f4071dfec
parent 19559 d35a89d5c0ec
parent 19872 e30b9163e84e
child 20079 8d884971c2ed
--- a/Set.st	Tue May 17 10:05:14 2016 +0100
+++ b/Set.st	Thu May 19 07:07:52 2016 +0200
@@ -813,7 +813,6 @@
 ! !
 
 
-
 !Set methodsFor:'obsolete set operations'!
 
 + aCollection
@@ -1239,7 +1238,6 @@
     ^ tally
 ! !
 
-
 !Set methodsFor:'searching'!
 
 findFirst:aBlock ifNone:exceptionValue
@@ -1266,6 +1264,7 @@
 includes:anObject
     "return true if the argument anObject is in the receiver"
 
+    tally == 0 ifTrue:[^ false]. "/ quick reject if empty
     ^ (self find:(anObject ? NilEntry) ifAbsent:0) ~~ 0
 !
 
@@ -1302,6 +1301,7 @@
     "return the number of occurrences of anObject in the receiver.
      As I am a Set, this can only return 0 or 1."
 
+    tally == 0 ifTrue:[^ 0]. 
     (self find:(anObject ? NilEntry) ifAbsent:0) == 0 ifTrue:[^ 0].
     ^ 1