SequenceableCollection.st
changeset 16254 60ddc11e769e
parent 16242 99f56f597d73
child 16392 9adc675755a4
--- a/SequenceableCollection.st	Tue Mar 11 10:36:08 2014 +0100
+++ b/SequenceableCollection.st	Thu Mar 13 17:34:17 2014 +0100
@@ -5095,15 +5095,18 @@
      and return a collection of those elements for which the block return true."
 
     |element newColl species needCopy
-     n  "{ Class:SmallInteger }"|
-
-    n := stopIndex - startIndex + 1.
+     sz  "{ Class:SmallInteger }"|
+
+    sz := stopIndex - startIndex + 1.
     species := self species.
     species growIsCheap ifTrue:[
-        newColl := self copyEmpty:n.
+        newColl := self copyEmpty:sz.
         needCopy := false
     ] ifFalse:[
-        newColl := OrderedCollection new:n.
+        sz == 0 ifTrue:[
+            ^ (species new:0) postCopyFrom:self.
+        ].
+        newColl := self speciesForAdding new:sz.
         needCopy := true
     ].
     startIndex to:stopIndex do:[:index |
@@ -9558,11 +9561,11 @@
 !SequenceableCollection class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/SequenceableCollection.st,v 1.370 2014-03-07 22:06:46 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/SequenceableCollection.st,v 1.371 2014-03-13 16:34:17 stefan Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/SequenceableCollection.st,v 1.370 2014-03-07 22:06:46 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/SequenceableCollection.st,v 1.371 2014-03-13 16:34:17 stefan Exp $'
 ! !