--- a/Collection.st Tue Oct 10 16:04:42 2017 +0200
+++ b/Collection.st Tue Oct 10 18:05:22 2017 +0200
@@ -1,3 +1,5 @@
+"{ Encoding: utf8 }"
+
"
COPYRIGHT (c) 1989 by Claus Gittinger
All Rights Reserved
@@ -155,13 +157,17 @@
!
newWithCapacity:n
- "return a new empty Collection with capacity for n elements.
+ "return a new empty Collection preferrably with capacity for n elements.
Redefined in StringCollection, where #new: returns a non-empty collection.
- This does not work for ArrayedCollections, which will be not empty."
-
- ^ self new:n
+ This does not work for ArrayedCollections, which will be not empty.
+
+ We return an empty collection here, because there are subclasses
+ which do not implement #new:."
+
+ ^ self new
"Created: / 09-10-2017 / 16:41:59 / stefan"
+ "Modified: / 10-10-2017 / 17:47:56 / stefan"
!
newWithSize:n
@@ -4483,7 +4489,7 @@
aStream nextPut:$)
"
- #(1 2 3 'hello' $a $ü) printOn:Transcript
+ #(1 2 3 'hello' $a $ü) printOn:Transcript
(Array new:100000) printOn:Transcript
(Array new:100000) printOn:Stdout
(Array new:100000) printString size
@@ -5842,7 +5848,7 @@
includesAll:aCollection
"return true if the receiver includes all elements of
the argument, aCollection; false if any is missing.
- Notice: this method has O² runtime behavior and may be
+ Notice: this method has O² runtime behavior and may be
slow for big receivers/args.
Think about using a Set, or Dictionary."
@@ -5862,7 +5868,7 @@
Return false if it includes none.
Uses #= (value compare)
Notice:
- this method has O² runtime behavior for some subclasses and may be slow for big receivers/args.
+ this method has O² runtime behavior for some subclasses and may be slow for big receivers/args.
Think about using a Set or Dictionary.
Some speedup is also possible, by arranging highly
probable elements towards the beginning of aCollection, to avoid useless searches.
@@ -5939,7 +5945,7 @@
Return false if it includes none.
Use identity compare for comparing.
Notice:
- this method has O² runtime behavior for some subclasses and may be slow for big receivers/args.
+ this method has O² runtime behavior for some subclasses and may be slow for big receivers/args.
Think about using a Set or Dictionary.
Some speedup is also possible, by arranging highly
probable elements towards the beginning of aCollection, to avoid useless searches."