Andreas Raab uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-ar.140.mcz==================== Summary ====================
Name: Collections-ar.140
Author: ar
Time: 29 September 2009, 10:01:41 am
UUID: 9d84c609-aac0-6043-b47c-c825840b0b83
Ancestors: Collections-ar.139, Collections-ul.139
Merging Collections-ul.139:
- remove old implementations of #rehash and #grow from Set's subclasses (except MethodDictionary)
=============== Diff against Collections-ar.139 ===============
Item was removed:
- ----- Method: Dictionary>>rehash (in category 'private') -----
- rehash
- "Smalltalk rehash."
- | newSelf |
- newSelf := self species new: self size.
- self associationsDo: [:each | newSelf noCheckAdd: each].
- array := newSelf array!
Item was removed:
- ----- Method: WeakKeyDictionary>>rehash (in category 'private') -----
- rehash
- "Rehash the receiver. Reimplemented to allow for multiple nil keys"
- | oldArray assoc newIndex |
- oldArray := array.
- array := Array new: oldArray size.
- tally := 0.
- 1 to: array size do:[:i|
- assoc := oldArray at: i.
- assoc ifNotNil:[
- newIndex := self scanForNil: assoc key.
- self atNewIndex: newIndex put: assoc.
- ].
- ].!
Item was removed:
- ----- Method: WeakSet>>grow (in category 'private') -----
- grow
- "Grow the elements array and reinsert the old elements"
-
- self growTo: array size + self growSize!
Item was removed:
- ----- Method: WeakKeyToCollectionDictionary>>rehash (in category 'as yet unclassified') -----
- rehash
- "Rehash the receiver. Reimplemented to remove nils from the collections
- that appear as values, and to entirely remove associations with empty collections
- as values."
- | oldArray assoc cleanedValue newIndex |
- oldArray := array.
- array := Array new: oldArray size.
- tally := 0.
- 1 to: array size do: [:i |
- assoc := oldArray at: i.
- (assoc notNil
- and: [(cleanedValue := assoc value copyWithout: nil) notEmpty])
- ifTrue: [newIndex := self scanForNil: assoc key.
- assoc value: cleanedValue.
- self atNewIndex: newIndex put: assoc]]!
Item was removed:
- ----- Method: KeyedSet>>rehash (in category 'private') -----
- rehash
- | newSelf |
- newSelf := self species new: self size.
- newSelf keyBlock: keyBlock.
- self do: [:each | newSelf noCheckAdd: each].
- array := newSelf array!
Item was removed:
- ----- Method: WeakSet>>rehash (in category 'private') -----
- rehash
- self growTo: array size!