On Tue, Aug 3, 2010 at 10:07 PM, Edward K. Ream <[email protected]> wrote:

> In general this will be fast enough because we expect small lists, but
> I'm not sure that the minor convenience is worth the worst-case
> behavior.

The convenience is not minor - the original API is not something that
should be published at all (i.e. it should be a private method).
c.deletepositions(list-of-positions-to-delete) is something you can
understand in a heartbeart.

This should be good enough for now. If it ever proves to be a problem,
it can be optimized. One optimization could me sorting positions by
depth and only comparing a position to "deeper" positions (because a
position can only be ancestor of a position with bigger depth).

Lexical sorting of the positions in general can give us linear speed -
if we have positions

1,1,3
1,1,3,2
1,2,12,2

We will see that a position can only be ancestor of the positions
directly following it in lexically sorted order.

But that's something that can be done later.


>
> Edward
>
> --
> You received this message because you are subscribed to the Google Groups 
> "leo-editor" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/leo-editor?hl=en.
>
>



-- 
Ville M. Vainio @@ Forum Nokia

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/leo-editor?hl=en.

Reply via email to