#TUNING by stefan
authorStefan Vogel <sv@exept.de>
Tue, 10 Oct 2017 18:06:26 +0200
changeset 22308 d6552a1b2fb9
parent 22307 ec05bef825fb
child 22309 a48cd79a42a5
#TUNING by stefan class: Bag class added: #newWithCapacity:
Bag.st
--- a/Bag.st	Tue Oct 10 18:05:47 2017 +0200
+++ b/Bag.st	Tue Oct 10 18:06:26 2017 +0200
@@ -1,3 +1,5 @@
+"{ Encoding: utf8 }"
+
 "
  COPYRIGHT (c) 1991 by Claus Gittinger
 	      All Rights Reserved
@@ -113,6 +115,14 @@
      Elements will be compared using equality compare (i.e. #= not #== identity)."
 
     ^ self equalityNew:size
+!
+
+newWithCapacity:size
+    "return a new empty Collection with capacity for n elements."
+
+    ^ self new:size
+
+    "Created: / 10-10-2017 / 17:49:15 / stefan"
 ! !
 
 !Bag methodsFor:'Compatibility-Dolphin'!