Changeset 1586

Show
Ignore:
Timestamp:
07/06/07 13:25:58 (1 year ago)
Author:
wrobe..@pld-linux.org
Message:

- speedup Canvas.update_now by creating a list of items to update instead

of two generators

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • gaphas/trunk/gaphas/canvas.py

    r1566 r1586  
    365365        """ 
    366366        self._in_update = True 
    367         dirty_items = [] 
     367 
     368        # Order the dirty items, so they are updated bottom to top 
     369        dirty_items = [ item for item in reversed(self._tree.nodes) \ 
     370                             if item in self._dirty_items ] 
     371 
    368372        # dirty_items is a subset of dirty_matrix_items 
    369373        dirty_matrix_items = set(self._dirty_matrix_items) 
     
    373377            for item in dirty_matrix_items: 
    374378                self._update_handles(item) 
    375  
    376             # Order the dirty items, so they are updated bottom to top 
    377             dirty_items = ( item for item in reversed(self._tree.nodes) \ 
    378                                  if item in self._dirty_items ) 
    379379 
    380380            context_map = dict() 
     
    392392 
    393393            self._solver.solve() 
    394  
    395             # Order the dirty items, so they are updated bottom to top 
    396             dirty_items = ( item for item in reversed(self._tree.nodes) \ 
    397                                  if item in self._dirty_items ) 
    398394 
    399395            dirty_matrix_items.update(self._dirty_matrix_items)