The Trunk: Collections-nice.574.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: Collections-nice.574.mcz

commits-2
Nicolas Cellier uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-nice.574.mcz

==================== Summary ====================

Name: Collections-nice.574
Author: nice
Time: 18 July 2014, 2:21:02.715 am
UUID: ee31aa60-b1d6-41cb-89ed-337ec58dcafe
Ancestors: Collections-ul.573

Less ascii/binary dance.
The sender of nextString doesn't try to force ascii, anymore so the implementor doesn't have to force binary.

=============== Diff against Collections-ul.573 ===============

Item was changed:
  ----- Method: PositionableStream>>nextString (in category 'nonhomogeneous accessing') -----
  nextString
+ "Read a string from the receiver. The first byte is the length of the string, unless it is greater than 192, in which case the first four bytes encode the length. This is restricted to Latin1 encoded String."
- "Read a string from the receiver. The first byte is the length of the string, unless it is greater than 192, in which case the first four bytes encode the length.  I expect to be in ascii mode when called (caller puts back to binary)."
 
  | length aByteArray |
-
- "read the length in binary mode"
- self binary.
  length := self next. "first byte."
  length >= 192 ifTrue: [length := length - 192.
  1 to: 3 do: [:ii | length := length * 256 + self next]].
  aByteArray := ByteArray new: length.
 
  self nextInto: aByteArray.
  ^aByteArray asString.
  !