Queue.st
changeset 582 837907b61b6b
parent 396 88bd6136ee67
child 587 3edcd7c02966
--- a/Queue.st	Wed Oct 15 21:09:28 1997 +0200
+++ b/Queue.st	Tue Oct 21 19:37:35 1997 +0200
@@ -10,6 +10,8 @@
  hereby transferred.
 "
 
+'From Smalltalk/X, Version:3.2.1 on 18-oct-1997 at 4:24:40 pm'                  !
+
 Collection subclass:#Queue
 	instanceVariableNames:'contentsArray readPosition writePosition tally'
 	classVariableNames:''
@@ -17,7 +19,7 @@
 	category:'Collections-Ordered'
 !
 
-!Queue  class methodsFor:'documentation'!
+!Queue class methodsFor:'documentation'!
 
 copyright
 "
@@ -55,7 +57,7 @@
 "
 ! !
 
-!Queue  class methodsFor:'instance creation'!
+!Queue class methodsFor:'instance creation'!
 
 new
     "return a new queue with space for some elements"
@@ -173,17 +175,20 @@
 do:aBlock
     "evaluate the argument, aBlock for each element in the queue"
 
-    |pos endPos|
+    |n   "{ Class: SmallInteger }"
+     pos "{ Class: SmallInteger }"|
 
     pos := readPosition.
-    endPos := writePosition.
-    1 to:tally do:[:i |
-	aBlock value:(contentsArray at:pos).
-	pos := pos + 1.
-	pos > contentsArray size ifTrue:[
-	    pos := 1
-	]
+    n := tally.
+    1 to:n do:[:i |
+        aBlock value:(contentsArray at:pos).
+        pos := pos + 1.
+        pos > contentsArray size ifTrue:[
+            pos := 1
+        ]
     ]
+
+    "Modified: 18.10.1997 / 16:24:01 / cg"
 ! !
 
 !Queue methodsFor:'initialization'!
@@ -223,8 +228,8 @@
     ^ tally
 ! !
 
-!Queue  class methodsFor:'documentation'!
+!Queue class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic2/Queue.st,v 1.18 1996-06-22 16:52:09 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic2/Queue.st,v 1.19 1997-10-21 17:37:35 cg Exp $'
 ! !