[squeak-dev] The Inbox: Collections-ul.933.mcz

commits at source.squeak.org commits at source.squeak.org
Wed Mar 31 00:18:58 UTC 2021


Levente Uzonyi uploaded a new version of Collections to project The Inbox:
http://source.squeak.org/inbox/Collections-ul.933.mcz

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

Name: Collections-ul.933
Author: ul
Time: 31 March 2021, 2:17:52.141067 am
UUID: b290ad2c-2ed0-4d46-b2fe-12545bf5f31c
Ancestors: Collections-ul.932

- use #ofSize: instead of #new: in SequenceableCollection class >> new:streamContents:, so that it creates a stream on a non-empty collection even if the receiver is OrderedCollection.

=============== Diff against Collections-ul.932 ===============

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



More information about the Squeak-dev mailing list