Marcel Taeumel uploaded a new version of Collections to project The Trunk: http://source.squeak.org/trunk/Collections-mt.1048.mcz
==================== Summary ====================
Name: Collections-mt.1048 Author: mt Time: 2 August 2023, 10:47:45.179314 am UUID: 87f828cf-6d3f-414e-82b7-a53244f9d19c Ancestors: Collections-dtl.1047
Makes #withoutDuplicates available to more kinds of collections. Offer #copyWithoutDuplicates as an alias matching the more explicit #copyWithout* protocol as we are always creating copies, even if the receiver does not contain any duplicates.
Do not allow duplicate removal for Bitset, CharacterSet, Heap, Matrix.
=============== Diff against Collections-dtl.1047 ===============
Item was added: + ----- Method: Bag>>withoutDuplicates (in category 'copying') ----- + withoutDuplicates + "Overwritten for better performance. We already know about the unique items in the receiver." + + ^ self species basicNew + setContents: (contents collect: [:count | 1]); + yourself!
Item was added: + ----- Method: Bitset>>withoutDuplicates (in category 'copying') ----- + withoutDuplicates + + self shouldNotImplement.!
Item was added: + ----- Method: CharacterSet>>withoutDuplicates (in category 'copying') ----- + withoutDuplicates + + self shouldNotImplement.!
Item was added: + ----- Method: Collection>>copyWithoutDuplicates (in category 'copying') ----- + copyWithoutDuplicates + "Convenience for the original #withoutDuplicates matching the copy-without protocol." + + ^ self withoutDuplicates!
Item was added: + ----- Method: Collection>>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 ifAbsentAdd: each]!
Item was added: + ----- Method: Heap>>withoutDuplicates (in category 'copying') ----- + withoutDuplicates + + self shouldNotImplement.!
Item was added: + ----- Method: Matrix>>withoutDuplicates (in category 'copying') ----- + withoutDuplicates + + self shouldNotImplement.!
Item was removed: - ----- 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 ifAbsentAdd: each]!
Item was added: + ----- Method: Set>>withoutDuplicates (in category 'copying') ----- + withoutDuplicates + "Overwritten for better performance. We already know about the unique items in the receiver." + + ^ self copy!
packages@lists.squeakfoundation.org