Andreas Raab uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-ar.176.mcz==================== Summary ====================
Name: Collections-ar.176
Author: ar
Time: 30 October 2009, 11:20:47 am
UUID: 99c0fe48-8a57-904d-b39a-67de96d0d748
Ancestors: Collections-nice.175, Collections-ul.175
Merging Name: Collections-ul.175
- reimplemented Set >> #rehashAllSets, it sends the new #rehashAllInstances to self and all subclasses.
- deprecated #quickRehashAllSets, because it didn't rehash all subinstances of Set and #rehashAllSets is fast enough with Kernel-ul.283, it also sends #rehashAllSets instead of the old implementation (no senders in trunk).
use it with Kernel-ul.283, load order doesn't matter
=============== Diff against Collections-nice.175 ===============
Item was changed:
----- Method: Set class>>quickRehashAllSets (in category 'initialization') -----
+ quickRehashAllSets
+
+ self deprecated: 'Use #rehashAllSets'.
+ self rehashAllSets!
- quickRehashAllSets "Set rehashAllSets"
- | insts |
- self withAllSubclassesDo:
- [:c |
- insts := c allInstances.
- (insts isEmpty or: [c = MethodDictionary]) ifFalse:
- ['Rehashing instances of ' , c name
- displayProgressAt: Sensor cursorPoint
- from: 1 to: insts size
- during: [:bar | 1 to: insts size do: [:x | bar value: x. (insts at: x) rehash]]
- ]
- ]!
Item was added:
+ ----- Method: Set class>>rehashAllInstances (in category 'initialization') -----
+ rehashAllInstances
+ "Do not use #allInstancesDo: because rehash may create new instances."
+
+ self allInstances do: [ :each | each rehash ] !
Item was changed:
----- Method: Set class>>rehashAllSets (in category 'initialization') -----
rehashAllSets
"Set rehashAllSets"
+
+ self withAllSubclassesDo: [ :each | each rehashAllInstances ]!
- self withAllSubclassesDo: [ :setClass |
- | instances |
- instances := setClass allInstances.
- instances isEmpty ifFalse: [
- 1 to: instances size do: [ :index |
- (instances at: index) rehash ] ] ]!