The Trunk: Collections-nice.930.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-nice.930.mcz

commits-2
Nicolas Cellier uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-nice.930.mcz

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

Name: Collections-nice.930
Author: nice
Time: 8 March 2021, 3:46:35.811868 pm
UUID: 923d86a7-1d60-4d7f-975a-c20e365efc5a
Ancestors: Collections-nice.929

Fix my horrible bug before it gets noticed **Blush**

I stupidely tested against Array (good) with #yourself as the collect: block (bad idea!)

=============== Diff against Collections-nice.929 ===============

Item was changed:
  ----- Method: LimitedPrecisionInterval>>collect: (in category 'enumerating') -----
  collect: aBlock
  "Evaluate aBlock with each of the receiver's elements as the argument.  
  Collect the resulting values into a collection like the receiver. Answer  
  the new collection.
  Implementation notes: see do: for an explanation on loop detail"
  | result |
  result := self species new: self size.
  1 to: result size do:
  [:i |
  "(self at: i) is inlined here to avoid repeated bound checking"
+ result at: i put: (aBlock value: i - 1 * step + start)].
- result at: i put: i - 1 * step + start].
  ^ result!