[squeak-dev] The Trunk: Collections-eem.756.mcz

commits at source.squeak.org commits at source.squeak.org
Wed Jun 14 18:03:45 UTC 2017

Eliot Miranda uploaded a new version of Collections to project The Trunk:

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

Name: Collections-eem.756
Author: eem
Time: 14 June 2017, 11:03:24.917631 am
UUID: 8d7c03bc-1cdb-44c7-9173-10d50c0dae29
Ancestors: Collections-eem.755

Add SequenceableCollection>>withoutDuplicates for a more elegant fix to MailMessage>>to:

=============== Diff against Collections-eem.755 ===============

Item was added:
+ ----- Method: SequenceableCollection>>withoutDuplicates (in category 'copying') -----
+ withoutDuplicates
+ 	"Answer a copy of the receiver that preserves order but eliminates any duplicates."
+ 	| seen |
+ 	seen := Set new: self size.
+ 	^self select: [:each|
+ 				  (seen includes: each)
+ 					ifTrue: [false]
+ 					ifFalse: [seen add: each. true]]!

More information about the Squeak-dev mailing list