The Trunk: Collections-cmm.801.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-cmm.801.mcz

commits-2
Chris Muller uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-cmm.801.mcz

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

Name: Collections-cmm.801
Author: cmm
Time: 15 July 2018, 4:33:18.797462 pm
UUID: dbaa6e91-604d-4f66-aef8-9c1900c499a7
Ancestors: Collections-ul.800

It turns out better and more consistent for String>>#condensedIntoOneLine to do a uniform conversion than trimBlanks.

=============== Diff against Collections-ul.800 ===============

Item was changed:
  ----- Method: String>>condensedIntoOneLine (in category 'converting') -----
  condensedIntoOneLine
  "Return a copy of the receiver with all separators converted to spaces, and with no consecutive spaces.  A formatting tool."
  ^ String streamContents:
  [ : stream | | prior |
+ prior := $X.  "some non-separator"
+ self do:
- prior := $X.  "any non-blank"
- self withBlanksTrimmed do:
  [ : char | char isSeparator ifTrue: [ prior isSeparator ifFalse: [stream space]] ifFalse: [ stream nextPut: char ].
  prior := char ] ]!