[squeak-dev] The Trunk: Collections-nice.830.mcz

commits at source.squeak.org commits at source.squeak.org
Tue May 7 07:25:24 UTC 2019


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

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

Name: Collections-nice.830
Author: nice
Time: 7 May 2019, 9:25:17.144861 am
UUID: 3eccc0fe-9098-4c67-ad2b-78b02e5287e5
Ancestors: Collections-nice.829, Collections-nice.499

Merge: Collections-nice.829, Collections-nice.499

Rename RunArray unique selector #addLast:times: as #add:withOccurrences: 
It's a bit less expressive but it's universal.
Deprecate #addLast:times:

After 6 years purgatory in inbox without further complaints, now is the last time I add an occurrence of this change.

=============== Diff against Collections-nice.829 ===============

Item was added:
+ ----- Method: RunArray>>add:withOccurrences: (in category 'adding') -----
+ add: value withOccurrences: times
+ 	"Add value as the last element of the receiver, the given number of times"
+ 	times = 0 ifTrue: [ ^self ].
+ 	lastIndex := nil.  "flush access cache"
+ 	(runs size=0 or: [values last ~= value])
+ 	  ifTrue:
+ 		[runs := runs copyWith: times.
+ 		values := values copyWith: value]
+ 	  ifFalse:
+ 		[runs at: runs size put: runs last+times]!

Item was removed:
- ----- Method: RunArray>>addLast:times: (in category 'adding') -----
- addLast: value  times: times
- 	"Add value as the last element of the receiver, the given number of times"
- 	times = 0 ifTrue: [ ^self ].
- 	lastIndex := nil.  "flush access cache"
- 	(runs size=0 or: [values last ~= value])
- 	  ifTrue:
- 		[runs := runs copyWith: times.
- 		values := values copyWith: value]
- 	  ifFalse:
- 		[runs at: runs size put: runs last+times]!



More information about the Squeak-dev mailing list