#TUNING by stefan
authorStefan Vogel <sv@exept.de>
Tue, 10 Oct 2017 18:06:53 +0200
changeset 4523 65f5494c3fa6
parent 4522 4c586a5945df
child 4524 e186b0f820b3
#TUNING by stefan class: PriorityQueue class added: #newWithCapacity:
PriorityQueue.st
--- a/PriorityQueue.st	Tue Oct 10 16:03:41 2017 +0200
+++ b/PriorityQueue.st	Tue Oct 10 18:06:53 2017 +0200
@@ -1,3 +1,5 @@
+"{ Encoding: utf8 }"
+
 "{ Package: 'stx:libbasic2' }"
 
 "{ NameSpace: Smalltalk }"
@@ -94,6 +96,14 @@
      the largest one's added"
 
     ^ self new initializeFor:maxSize comparator:aBlock
+!
+
+newWithCapacity:size
+    "return a new empty Collection with capacity for n elements."
+
+    ^ self new:size
+
+    "Created: / 10-10-2017 / 17:52:55 / stefan"
 ! !
 
 !PriorityQueue methodsFor:'adding'!