Rick Howe wrote:
> > > I still see a nested while loop. Is that readlly needed?
> >
> > I think so because a match list is orderd by a priority not an ID.
> > However, if we really need to reduce a nested loop,
> > a simple idea is something like this:
> >
> > cur = wp->w_match_head;
> > while (cur != NULL && cur->id != wp->w_next_match_id)
> > cur = cur->next;
> > if (cur == NULL)
> > id = wp->w_next_match_id;
> > else
> > id = wp->w_manual_match_id_max + 1000;
> > wp->w_next_match_id = id + 1
> >
> > Once a overlap is found, intentionally assign max manual ID + 1000 as ID.
> > The ID can be overlapped later though.
>
> I tried to think it over again.
> In the current mechanism, it is not possible to completely eliminate
> an overlap between manual and automatic IDs.
> Add 1000 here is to just reduce its possibility.
> If that idea is acceptable, I would like to return back to my 1st proposal,
> because it is more simple and no while loop is necessary.
> Please let me know your concern.
It's probably find. Please write some tests so we can see what the
result looks like.
--
GALAHAD: No, please. Please! I can defeat them! There's only a hundred.
GIRLS: He will beat us easily. We haven't a chance.
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.