The Trunk: Collections-ul.562.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-ul.562.mcz

commits-2
Levente Uzonyi uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-ul.562.mcz

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

Name: Collections-ul.562
Author: ul
Time: 20 January 2014, 4:50:22.53 pm
UUID: 7f1df35e-341a-4826-af42-ad9fba9311e3
Ancestors: Collections-cwp.561

- fixed SequenceableCollection class >> new:streamContents: as suggested by Nicolas Cellier

=============== Diff against Collections-cwp.561 ===============

Item was changed:
  ----- Method: SequenceableCollection class>>new:streamContents: (in category 'stream creation') -----
  new: newSize streamContents: blockWithArg
 
+ | stream originalContents |
- | stream |
  stream := WriteStream on: (self new: newSize).
  blockWithArg value: stream.
+ originalContents := stream originalContents.
+ (originalContents size = newSize and: [ stream position = newSize ])
+ ifTrue: [ ^originalContents ]
- stream position = newSize
- ifTrue: [ ^stream originalContents ]
  ifFalse: [ ^stream contents ]!