Nicolas Cellier uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-nice.135.mcz==================== Summary ====================
Name: Collections-nice.135
Author: nice
Time: 17 September 2009, 10:27:24 am
UUID: 13ffdd74-b12a-4d7c-9277-b7e55dd6d29f
Ancestors: Collections-ar.134
Merge #removeAll from inbox/Collections-klub.131
Its implementation looks good.
I did not load the conflicting methods: apart comments, there are 3 of them:
Collection>>#removeAll:
he uses a #copy when I did not
OrderedCollection>>#removeAll
Set>>#removeAll
WeakSet>>#removeAll
klub preserves the same array using atAllPut: nil, when I create a new one.
klub version will take a little longer to perform.
Might perform better in case of huge collections ?
(avoiding swap, putting less pressure on garbageCollector...)
Anyone having an advice about this ?
Concerning Set, he has to implement #removeAll in WeakSet, while I have to implement in KeyedSet, so 1-1
Obviously, it would be good to extend the tests to more collection subclasses, to check whether our two implementations have holes or not
=============== Diff against Collections-ar.134 ===============
Item was added:
+ ----- Method: Matrix>>removeAll (in category 'removing') -----
+ removeAll
+
+ self shouldNotImplement!
Item was added:
+ ----- Method: CharacterSet>>removeAll (in category 'removing') -----
+ removeAll
+
+ map atAllPut: 0!
Item was added:
+ ----- Method: Heap>>removeAll (in category 'removing') -----
+ removeAll
+
+ array atAllPut: nil.
+ tally := 0!
Item was added:
+ ----- Method: ArrayedCollection>>removeAll (in category 'removing') -----
+ removeAll
+
+ self shouldNotImplement!