Without any measurement I think that this can be further simplified and 
speed up. The all_positions_for_v builds and yields positions, which means 
it builds entire stacks of (v, index) pairs for each visited v node. And 
for marking dirty parents it doesn't need to build positions at all. The 
following is not tested but I believe it should work.

def collect_dirty_parents(v):

    def it(ch):
        yield ch
        for par in ch.parents:
            yield from it(par)
    dirty_nodes = [x for x in it(v) if x.isAnyAtFileNode() and not x.isDirty
()]

    for x in dirty_nodes:
        x.setDirty()

    return dirty_nodes

Vitalije 

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/879a9ca5-3522-4689-8de5-8f77533d0339%40googlegroups.com.

Reply via email to