Nicolas Cellier uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-nice.170.mcz==================== Summary ====================
Name: Collections-nice.170
Author: nice
Time: 20 October 2009, 11:24:20 am
UUID: 3451e8e1-37eb-48b0-ada6-6f49b067d81e
Ancestors: Collections-nice.169
Make keys answer an Array rather than a Set/IdentitySet/PluggableSet
WARNING: cross your fingers...
=============== Diff against Collections-nice.169 ===============
Item was changed:
----- Method: KeyedSet>>keys (in category 'accessing') -----
keys
+ "Answer an Array containing the receiver's keys."
+
+ ^Array new: self size streamContents: [:s| self keysDo: [:key| s nextPut: key]]!
-
- | keys |
- keys := Set new.
- self keysDo: [:key | keys add: key].
- ^ keys!
Item was changed:
----- Method: Dictionary>>keys (in category 'accessing') -----
keys
+ "Answer an Array containing the receiver's keys."
+
+ ^Array new: self size streamContents: [:s| self keysDo: [:key| s nextPut: key]]!
- "Answer a Set containing the receiver's keys."
- | aSet |
- aSet := Set new: self size.
- self keysDo: [:key | aSet add: key].
- ^ aSet!
Item was removed:
- ----- Method: IdentityDictionary>>keys (in category 'private') -----
- keys
- "Answer a Set containing the receiver's keys."
- | aSet |
- aSet := IdentitySet new: self size.
- self keysDo: [:key | aSet add: key].
- ^ aSet!
Item was removed:
- ----- Method: PluggableDictionary>>keys (in category 'accessing') -----
- keys
- "Answer a Set containing the receiver's keys."
- | aSet |
- aSet := PluggableSet new: self size.
- self equalBlock ifNotNil: [aSet equalBlock: self equalBlock fixTemps].
- self hashBlock ifNotNil: [aSet hashBlock: self hashBlock fixTemps].
- self keysDo: [:key | aSet add: key].
- ^ aSet!