Levente Uzonyi uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-ul.319.mcz==================== Summary ====================
Name: Kernel-ul.319
Author: ul
Time: 3 December 2009, 5:12:50 am
UUID: b8275b69-ee08-9f45-b8c2-7e020776e941
Ancestors: Kernel-dtl.318
From:
http://bugs.squeak.org/view.php?id=7166- improved preformance for Behavior >> #allSelectors
- added Behavior >> #allSelectorsBelow:
=============== Diff against Kernel-dtl.318 ===============
Item was added:
+ ----- Method: Behavior>>allSelectorsBelow: (in category 'accessing method dictionary') -----
+ allSelectorsBelow: topClass
+ | coll |
+ coll := IdentitySet new.
+ self withAllSuperclassesDo:
+ [:aClass |
+ aClass = topClass
+ ifTrue: [^ coll ]
+ ifFalse: [aClass selectorsDo: [ :sel | coll add: sel ]]].
+ ^ coll
+
+
+ !
Item was changed:
----- Method: Behavior>>allSelectors (in category 'accessing method dictionary') -----
allSelectors
+ "Answer all selectors understood by instances of the receiver"
- "Answer all selectors understood by instances of the receiver"
+ ^(Array streamContents: [ :stream |
+ self withAllSuperclassesDo: [ :aClass |
+ aClass selectorsDo: [ :each |
+ stream nextPut: each ] ] ]) asIdentitySet!
- | coll |
- coll := OrderedCollection new.
- self withAllSuperclasses do:
- [:aClass | coll addAll: aClass selectors].
- ^ coll asIdentitySet!