[squeak-dev] The Inbox: Collections-ul.139.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[squeak-dev] The Inbox: Collections-ul.139.mcz

commits-2
A new version of Collections was added to project The Inbox:
http://source.squeak.org/inbox/Collections-ul.139.mcz

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

Name: Collections-ul.139
Author: ul
Time: 20 September 2009, 3:59:02 am
UUID: 709e2f94-568a-8b48-9aa8-e428b7c3cd4a
Ancestors: Collections-ul.138

Warning! Don't load this without having Collections-ul.138 in your image!

- remove old implementations of #rehash and #grow from Set's subclasses (except MethodDictionary)

=============== Diff against Collections-ul.138 ===============

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!