On Feb 20, 2010, at 12:07 AM, Igor Stasenko wrote:
On 20 February 2010 00:50, Marcus Denker <marcus.denker@inria.fr> wrote:
On Feb 19, 2010, at 10:54 PM, Richard Durr wrote:
It somehow feels quicker!?
Hmm... we did not do anything that should have any major impact on perfomance... related to code that is actually executed, since 11208, there was just some cleanup in Morph>>#delete and Window-activiation, but I guess that should not lead to a measurable impact.
who knows :)
this was called on each window activation: extantSketchEditor "If my world has an extant SketchEditorMorph associated with anything in this window, return that SketchEditor, else return nil" | w sketchEditor pasteUp | (w := self world) isNil ifTrue: [^ nil]. (sketchEditor := w sketchEditorOrNil) isNil ifTrue: [^ nil]. (pasteUp := sketchEditor enclosingPasteUpMorph) isNil ifTrue: [^ nil]. self findDeepSubmorphThat: [:m | m = pasteUp] ifAbsent: [^ nil]. ^ sketchEditor with: sketchEditorOrNil "Return a SketchEditorMorph found in the world, if any, else nil" ^ Smalltalk at: #SketchEditorMorph ifPresent: [ :class | self findA: class ] findA: aClass "Return the first submorph of the receiver that is descended from the given class. Return nil if there is no such submorph. Clients of this code should always check for a nil return value so that the code will be robust if the user takes the morph apart." ^self submorphs detect: [:p | p isKindOf: aClass] ifNone: [nil] ... which means that it actually iterated over the complete submorph-tree of the world to find a SketchEditor... So yes, maybe that will slow things down a little. :-) (And, honestly, the more I clean Morphic, the more I am amazed about the genius needed to build something like that...) Marcus -- Marcus Denker -- http://www.marcusdenker.de INRIA Lille -- Nord Europe. Team RMoD.