#BUGFIX by stefan
authorStefan Vogel <sv@exept.de>
Thu, 09 Nov 2017 07:04:34 +0100
changeset 22334 8e2e3cb23910
parent 22333 3c675c8b5266
child 22335 6cef913b016d
#BUGFIX by stefan class: Collection class changed: #withAll: didn't work with Iterator. https://expeccoalm.exept.de/D225102
Collection.st
--- a/Collection.st	Wed Nov 08 18:03:14 2017 +0100
+++ b/Collection.st	Thu Nov 09 07:04:34 2017 +0100
@@ -268,18 +268,23 @@
     "return a new Collection with all elements taken from the argument,
      aCollection"
 
-    ^ (self newWithCapacity:aCollection size)
+"/ Doesn't work with Iterator:
+"/    ^ (self newWithCapacity:aCollection size)
+
+    ^ self new
         addAll:aCollection;
         yourself.
 
+
     "
         OrderedCollection withAll:#(1 2 3 4 5 6)
         Set withAll:#(1 2 3 4 5 6)
         StringCollection withAll:#('line1' 'line2' 'line3')
         String withAll:#($a $b $c)
-    "
-
-    "Modified (comment): / 09-10-2017 / 16:52:25 / stefan"
+        Set withAll:(Iterator on:[:whatToDo | 1 to:10 do:[:i | whatToDo value:i]]).
+    "
+
+    "Modified (comment): / 09-11-2017 / 07:03:53 / stefan"
 !
 
 withSize:n