The Trunk: Collections-bf.787.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-bf.787.mcz

commits-2
Bert Freudenberg uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-bf.787.mcz

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

Name: Collections-bf.787
Author: bf
Time: 26 April 2018, 1:25:29.283438 pm
UUID: ed53996c-b8a6-40b7-a186-37ec55737b62
Ancestors: Collections-pre.786

Allow to write Strings to binary WriteStream.

=============== Diff against Collections-pre.786 ===============

Item was changed:
  ----- Method: WriteStream>>nextPutAll: (in category 'accessing') -----
  nextPutAll: aCollection
 
  | newEnd |
  (collection class == aCollection class
+ or: [ collection class isBits
- or: [ collection isString
  and: [ aCollection isString
  and: [ collection class format = aCollection class format ] ] ]) "Let Strings with the same field size as collection take the quick route too."
  ifFalse: [ ^ super nextPutAll: aCollection ].
 
  newEnd := position + aCollection size.
  newEnd > writeLimit ifTrue:
  [self growTo: newEnd + 10].
 
  collection replaceFrom: position+1 to: newEnd  with: aCollection startingAt: 1.
  position := newEnd.
  ^aCollection!