+occurrencesOfAny
authorClaus Gittinger <cg@exept.de>
Tue, 30 Mar 2004 20:46:20 +0200
changeset 8275 1f2d4a880b69
parent 8274 729d36911f18
child 8276 9720407471d6
+occurrencesOfAny
Collection.st
--- a/Collection.st	Tue Mar 30 20:45:58 2004 +0200
+++ b/Collection.st	Tue Mar 30 20:46:20 2004 +0200
@@ -2718,16 +2718,8 @@
     |count "{ Class: SmallInteger }" |
 
     count := 0.
-    aCollectionOfElements size < self size ifTrue:[
-        aCollectionOfElements do:[:element |
-            count := count + (self occurrencesOf:element)
-        ].
-    ] ifFalse:[
-        self do:[:element |
-            (aCollectionOfElements includes:element) ifTrue:[
-                count := count + 1
-            ].
-        ].
+    aCollectionOfElements do:[:element |
+        count := count + (self occurrencesOf:element)
     ].
     ^ count
 
@@ -2751,7 +2743,7 @@
 !Collection class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Collection.st,v 1.160 2004-03-30 18:45:58 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Collection.st,v 1.161 2004-03-30 18:46:20 cg Exp $'
 ! !
 
 Collection initialize!