The Inbox: Collections-ct.932.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Inbox: Collections-ct.932.mcz

commits-2
A new version of Collections was added to project The Inbox:
http://source.squeak.org/inbox/Collections-ct.932.mcz

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

Name: Collections-ct.932
Author: ct
Time: 19 March 2021, 11:02:25.937058 pm
UUID: 557fe993-fe03-4e44-8723-ce0f8d597f9f
Ancestors: Collections-dtl.931

Fixes a bug in the fallback version of String>>#replaceFrom:to:with:startingAt:. If the replacement contains integers, they should be converted into Characters. See ByteArray>>#asString.

=============== Diff against Collections-dtl.931 ===============

Item was changed:
  ----- Method: String>>replaceFrom:to:with:startingAt: (in category 'private') -----
  replaceFrom: start to: stop with: replacement startingAt: repStart
  "Primitive. This destructively replaces elements from start to stop in the receiver starting at index, repStart, in the collection, replacement. Answer the receiver. Range checks are performed in the primitive only. Optional. See Object documentation whatIsAPrimitive."
  <primitive: 105>
+ | index repOff |
+ repOff := repStart - start.
+ index := start - 1.
+ [(index := index + 1) <= stop]
+ whileTrue: [self at: index put: (replacement at: repOff + index) asCharacter].!
- super replaceFrom: start to: stop with: replacement startingAt: repStart!