WriteStream.st
changeset 2863 aec08a0c2c2e
parent 2410 eea60bba0412
child 2864 328b52ecd339
--- a/WriteStream.st	Tue Aug 19 15:51:32 1997 +0200
+++ b/WriteStream.st	Tue Aug 19 18:08:22 1997 +0200
@@ -98,7 +98,11 @@
 !WriteStream methodsFor:'private'!
 
 growCollection
+    "grow the streamed collection to at least 10 elements"
+
     self growCollection:10
+
+    "Modified: 19.8.1997 / 17:53:28 / cg"
 !
 
 growCollection:minNewSize
@@ -108,20 +112,20 @@
 
     oldSize := collection size.
     (oldSize == 0) ifTrue:[
-	newSize := minNewSize
+        newSize := minNewSize
     ] ifFalse:[
-	newSize := oldSize * 2.
-	[newSize < minNewSize] whileTrue:[
-	    newSize := newSize * 2
-	]
+        newSize := oldSize * 2.
+        (newSize < minNewSize) ifTrue:[newSize := minNewSize].
     ].
     collection isFixedSize ifTrue:[
-	newColl := collection species new:newSize.
-	newColl replaceFrom:1 to:oldSize with:collection startingAt:1.
-	collection := newColl
+        newColl := collection species new:newSize.
+        newColl replaceFrom:1 to:oldSize with:collection startingAt:1.
+        collection := newColl
     ] ifFalse:[
-	collection grow:newSize
+        collection grow:newSize
     ].
+
+    "Modified: 19.8.1997 / 17:53:11 / cg"
 ! !
 
 !WriteStream methodsFor:'private accessing'!
@@ -187,7 +191,7 @@
 
 nextPut:anObject
     "append the argument, anObject to the stream.
-     Special tuned for appending to String, ByteArray and Array streams."
+     Specially tuned for appending to String, ByteArray and Array streams."
 
 %{  /* NOCONTEXT */
 
@@ -219,7 +223,7 @@
                 if (__isCharacter(anObject) 
                  && (pos <= __stringSize(coll))) {
                     ch = __intVal(_characterVal(anObject));
-                    if ((ch >= 0) && (ch <= 255)) {
+                    if (ch <= 255) {
                         __StringInstPtr(coll)->s_element[pos-1] = ch;
                         __INST(position) = __MKSMALLINT(pos + 1);
                         if ((__readLimit >= 0) && (pos >= __readLimit)) {
@@ -343,5 +347,5 @@
 !WriteStream class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/WriteStream.st,v 1.33 1997-02-19 12:07:02 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/WriteStream.st,v 1.34 1997-08-19 16:08:22 cg Exp $'
 ! !