--- a/ReadStream.st Wed May 17 15:14:55 2017 +0200
+++ b/ReadStream.st Wed May 17 15:14:56 2017 +0200
@@ -97,7 +97,6 @@
"Modified: / 12-09-2010 / 13:06:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
-
!ReadStream methodsFor:'converting'!
readStream
@@ -894,7 +893,7 @@
Does NOT skip initial whitespace.
The streams elements should be characters.
- Be careful - this method returns 0 if not positioned on a digit intitially
+ Be careful - this method returns 0 if not positioned on a digit initially
or if the end of the stream is encountered.
Tuned for speed on String-Streams for faster scanning"
@@ -913,28 +912,28 @@
if (__isStringLike(coll) && __bothSmallInteger(p, l)) {
- pos = __intVal(p);
- /* make 1-based */
- pos++;
- limit = __intVal(l);
- sz = __qSize(coll) - OHDR_SIZE;
- if (sz < limit)
- limit = sz;
- cp = __stringVal(coll) + pos - 1;
+ pos = __intVal(p);
+ /* make 1-based */
+ pos++;
+ limit = __intVal(l);
+ sz = __qSize(coll) - OHDR_SIZE;
+ if (sz < limit)
+ limit = sz;
+ cp = __stringVal(coll) + pos - 1;
- for (;;) {
- if (pos > limit) break;
- ch = *cp;
+ for (;;) {
+ if (pos > limit) break;
+ ch = *cp;
- if ((ch < '0') || (ch > '9')) break;
- val = val * 10 + (ch - '0');
- pos++;
- if (val > (_MAX_INT / 10)) goto oops;
- cp++;
- }
- pos--;
- __INST(position) = __mkSmallInteger(pos);
- RETURN (__mkSmallInteger(val));
+ if ((ch < '0') || (ch > '9')) break;
+ val = val * 10 + (ch - '0');
+ pos++;
+ if (val > (_MAX_INT / 10)) goto oops;
+ cp++;
+ }
+ pos--;
+ __INST(position) = __mkSmallInteger(pos);
+ RETURN (__mkSmallInteger(val));
}
oops:
value = __mkSmallInteger(val);
@@ -946,10 +945,12 @@
nextOne := self peek.
[nextOne notNil and:[nextOne isDigitRadix:10]] whileTrue:[
- value := (value * 10) + nextOne digitValue.
- nextOne := self nextPeek
+ value := (value * 10) + nextOne digitValue.
+ nextOne := self nextPeek
].
^ value
+
+ "Modified: / 17-05-2017 / 15:12:46 / mawalch"
! !
!ReadStream methodsFor:'writing'!