The Trunk: Collections-bf.761.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-bf.761.mcz

commits-2
Bert Freudenberg uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-bf.761.mcz

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

Name: Collections-bf.761
Author: bf
Time: 20 July 2017, 12:42:02.196604 pm
UUID: 5b68150c-4eb0-4210-9fac-c4aa09623b6d
Ancestors: Collections-eem.760

Remove ByteArray>>at:put: and fix the fallback code in ByteArray>>#replaceFrom:to:with:startingAt: to match prim 105

=============== Diff against Collections-eem.760 ===============

Item was removed:
- ----- Method: ByteArray>>at:put: (in category 'accessing') -----
- at: index put: value
- <primitive: 61> "try primitiveAtPut, convert value to integer if that fails and try again"
- ^ self byteAt: index put: value asInteger
- !

Item was changed:
  ----- Method: ByteArray>>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>
+ replacement isString
+ ifFalse:
+ [super replaceFrom: start to: stop with: replacement startingAt: repStart]
+ ifTrue:
+ [ "use String>>byteAt: to mimic prim 105"
+ | index repOff |
+ repOff := repStart - start.
+ index := start - 1.
+ [(index := index + 1) <= stop]
+ whileTrue: [self at: index put: (replacement byteAt: repOff + index)]]
+ !
- super replaceFrom: start to: stop with: replacement startingAt: repStart!