Andreas Raab uploaded a new version of MorphicExtras to project The Trunk:
http://source.squeak.org/trunk/MorphicExtras-eem.43.mcz==================== Summary ====================
Name: MorphicExtras-eem.43
Author: eem
Time: 21 August 2009, 4:26:10 am
UUID: 8b3369f7-e934-4eba-a99a-0903c27741a9
Ancestors: MorphicExtras-ar.42
Speedup CommandHistory class>>resetAllHistory effectively by using MorphExtension allInstances instead of allObjectsDo:. Shaves a few tenths of a second from start-up time of a typical image.
=============== Diff against MorphicExtras-ar.42 ===============
Item was changed:
----- Method: CommandHistory class>>resetAllHistory (in category 'system startup') -----
resetAllHistory
"Reset all command histories, and make all morphs that might be holding on to undo-grab-commands forget them"
self allInstancesDo: [:c | c resetCommandHistory].
+ MorphExtension withAllSubclassesDo:
+ [:mexc|
+ self forgetAllGrabCommandsFrom: mexc someInstance]
- self forgetAllGrabCommandsFrom: self someObject.
"CommandHistory resetAllHistory"
!
Item was changed:
----- Method: CommandHistory class>>forgetAllGrabCommandsFrom: (in category 'system startup') -----
+ forgetAllGrabCommandsFrom: starterInstance
- forgetAllGrabCommandsFrom: starter
"Forget all the commands that might be held on to in the properties dicitonary of various morphs for various reasons."
+ | object |
+ object := starterInstance.
- | object lastObject |
- object := starter.
- lastObject := Object new.
[
+ [nil == object] whileFalse: [
+ object removeProperty: #undoGrabCommand.
+ object := object nextInstance].
- [lastObject == object] whileFalse: [
- object isMorph ifTrue: [object removeProperty: #undoGrabCommand].
- object := object nextObject].
] ifError: [:err :rcvr | "object is obsolete"
+ self forgetAllGrabCommandsFrom: object nextInstance].
- self forgetAllGrabCommandsFrom: object nextObject].
+ "CommandHistory forgetAllGrabCommandsFrom: MorphExtension someInstance"
- "CommandHistory forgetAllGrabCommandsFrom: true someObject"
!