On Monday, October 14, 2019 at 4:22:46 AM UTC-5, vitalije wrote:

Here is a very fast way to iterate all positions for a given vnode:
>

This is one place where speed is truly useful!!

Here is the present code for p.setAllAncestorAtFileNodesDirty:

def setAllAncestorAtFileNodesDirty(self, setDescendentsDirty=False):
    """Rewritten in Leo 6.1"""
    p = self
    c = p.v.context
    dirtyVnodeList = []
    for p2 in c.all_positions_for_v(p.v):
        for parent in p2.self_and_parents():
            if parent.isAnyAtFileNode() and not parent.v.isDirty():
                dirtyVnodeList.append(parent.v)
    for v in dirtyVnodeList:
        v.setDirty()
    return dirtyVnodeList

Notice: *the setDescendentsDirty kwarg is not used*.  I believe this is 
sound, because of the generality of c.all_positions_for_v.  The result is a 
spectacular collapse in the code.  In particular, the horrible 
p/v.findAllPotentiallyDirtyNodes methods are no longer needed.

The new code is in the "dirty" branch.  I want to test further before 
merging into devel.

Thanks again, Vitalije, for a superb optimization.

Edward

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/dd380ec9-5758-4c6f-a289-aaad5af28cbe%40googlegroups.com.

Reply via email to