[squeak-dev] The Inbox: Collections-ct.950.mcz
commits at source.squeak.org
commits at source.squeak.org
Tue Jun 29 23:06:42 UTC 2021
A new version of Collections was added to project The Inbox:
http://source.squeak.org/inbox/Collections-ct.950.mcz
==================== Summary ====================
Name: Collections-ct.950
Author: ct
Time: 30 June 2021, 1:06:39.38741 am
UUID: 58b871bc-ace9-184b-8e98-305453096350
Ancestors: Collections-mt.945
Fixes Stream >> #take:. Unlike in #any:, we must not return nil values from #next here but the enumeration earlier. See CollectionsTests-ct.361.
=============== Diff against Collections-mt.945 ===============
Item was changed:
----- Method: Stream>>take: (in category 'collections - accessing') -----
take: maxNumberOfElements
"See Collection protocol."
+
+ | aCollection |
+ aCollection := OrderedCollection new.
+ maxNumberOfElements timesRepeat: [
+ self atEnd ifTrue: [^ aCollection].
+ aCollection addLast: self next].
+ ^ aCollection!
-
- ^ self any: maxNumberOfElements!
More information about the Squeak-dev
mailing list
|