[squeak-dev] The Inbox: Monticello-nice.545.mcz

Nicolas Cellier nicolas.cellier.aka.nice at gmail.com
Tue May 28 21:15:01 UTC 2013


Ah yes, that's right, it's because I made the minimal change to the method.
This is an un-necessary change anyway, but those RWBinaryOrTextStream are
one of the things that most annoys me ;)



2013/5/24 Levente Uzonyi <leves at elte.hu>

> On Thu, 23 May 2013, commits at source.squeak.org wrote:
>
>  Nicolas Cellier uploaded a new version of Monticello to project The Inbox:
>> http://source.squeak.org/**inbox/Monticello-nice.545.mcz<http://source.squeak.org/inbox/Monticello-nice.545.mcz>
>>
>> Item was changed:
>>  ----- Method: MCMczWriter>>**serializeDefinitions: (in category
>> 'serializing') -----
>>  serializeDefinitions: aCollection
>>         | writer s |
>> +       s := String new writeStream.
>> -       s := RWBinaryOrTextStream on: String new.
>>         writer := self snapshotWriterClass on: s.
>>         writer writeDefinitions: aCollection.
>>         ^ s contents!
>>
>
> More nitpicking:
> Using "String new writeStream" is inefficient compared to "String
> streamContents: []". It also requires the use of local variables and an
> extra message send. How about this?
>
> serializeDefinitions: aCollection
>
>         ^String streamContents: [ :stream |
>                 (self snapshotWriterClass on: stream)
>                         writeDefinitions: aCollection ]
>
>
>
>> Item was changed:
>>  ----- Method: MCStReader>>readStream (in category 'evaluating') -----
>>  readStream
>> +       | contents |
>> +       contents := stream contents.
>>         ^ ('!!!!
>>
>> + ', ([contents utf8ToSqueak] on: InvalidUTF8 do: [:exc | exc return:
>> contents])) readStream!
>> - ', stream contents) readStream!
>>
>> Item was changed:
>>  ----- Method: MCStWriter>>writeDefinitions: (in category 'writing') -----
>>  writeDefinitions: aCollection
>>         "initStream is an ugly hack until we have proper init defs"
>>         initStream := String new writeStream.
>>
>>         (MCDependencySorter sortItems: aCollection)
>>                 do: [:ea | ea accept: self]
>>                 displayingProgress: 'Writing definitions...'.
>>
>> +       stream nextPutAll: initStream contents squeakToUtf8.!
>> -       stream nextPutAll: initStream contents.!
>>
>>
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20130528/86e24eb5/attachment.htm


More information about the Squeak-dev mailing list