# HG changeset patch # User Claus Gittinger # Date 1430750475 -7200 # Node ID c13a1f4f4ccb4f6906a3da4f756f62cfc4b1d8fc # Parent 1ce6db31fcdfa0a3f4de0dc29d6f5682f7831e9f class: Tools::ViewTreeInspectorApplication updateChildren: doe it without going deep into recursion diff -r 1ce6db31fcdf -r c13a1f4f4ccb Tools__ViewTreeApplication.st --- a/Tools__ViewTreeApplication.st Thu Mar 26 11:20:01 2015 +0100 +++ b/Tools__ViewTreeApplication.st Mon May 04 16:41:15 2015 +0200 @@ -1,3 +1,5 @@ +"{ Encoding: utf8 }" + " COPYRIGHT (c) 2007 by eXept Software AG All Rights Reserved @@ -2900,18 +2902,29 @@ !ViewTreeInspectorApplication::ViewTreeItem methodsFor:'operations update'! updateChildren - |list| - - self do:[:el| - el exists ifTrue:[ - el updateChildren. - ] ifFalse:[ - list isNil ifTrue:[list := OrderedCollection new]. - list add:el. - ] - ]. - list notNil ifTrue:[ - list do:[:el| self remove:el ]. + |queue| + + queue := OrderedCollection new. + queue add:self. + + self criticalDo:[ + [queue notEmpty] whileTrue:[ + |toRemove elProcessed| + + elProcessed := queue removeFirst. + toRemove := nil. + elProcessed nonCriticalDo:[:el| + el exists ifTrue:[ + queue add:el. + ] ifFalse:[ + toRemove isNil ifTrue:[toRemove := OrderedCollection new]. + toRemove add:el. + ] + ]. + toRemove notNil ifTrue:[ + toRemove do:[:el| self remove:el ]. + ]. + ]. ]. !