On Tue, Mar 17, 2020 at 2:56 AM vitalije <[email protected]> wrote:
I would suggest another approach. What is the essence of this operation? If > we compare the tree before and after this operation, the difference between > them is just a bunch of links that were cut. > Yes, I think this is correct. Thank you for these comments, they are helpful. My intuition says that that the computation of the links to be cut must be done *anew* for every position in the original list of positions. That way we can be *sure* that deleting positions can be done in any (or all) orders. In other words, the code you suggest might lead to a simpler way of doing p.position_after_deleting, but I think the main loop of p.deletePositionsInList should stay pretty much as I have shown. I have just created the delete branch <https://github.com/leo-editor/leo-editor/branches/active> for #1539 <https://github.com/leo-editor/leo-editor/issues/1539>. This will allow us both to propose code and unit tests. Imo, a necessary, but *not* sufficient unit test for p.deletePositionsInList will verify that all permutations of the positions in the list lead to identical results. This issue is presently scheduled for 6.3. I am open to making it part of 6.2 if you and I can agree that the new code is sound. 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/CAMF8tS1FQ29Ly-BEzZL45F07HhLoxKZRF6X0wH39dgj1pJcRKw%40mail.gmail.com.
