Rick Howe wrote:

> Please let me tell you another proposal.
> The original problem is that w_next_match_id has to be *always* checked
> the duplicate with formerly assigned manual ids.
> I introduced 2 new variables
> w_manual_match_id_min
> w_manual_match_id_max
> to remember the historical minimum and maximum match ids of manuals.
> If w_next_match_id is between those 2 variables, need to check the
> duplicate same as currently.
> Otherwise, it can simply use w_next_match_id witout the check.

Yeah, I suggested that a few days ago.  I think it should be combined
with, when the next match ID is in that range, adding 1000 or so to
avoid the ranges to overlap.

> As a result,
> matchaddpos('ToDo', [[1]], 10) returns 4
> matchaddpos('ToDo', [[1]], 10, 1000) returns 1000
> matchaddpos('ToDo', [[1]], 10) returns 5
> matchaddpos('ToDo', [[1]], 10) returns 6
> matchaddpos('ToDo', [[1]], 10, 500) returns 500
> matchaddpos('ToDo', [[1]], 10) returns 7
> matchaddpos('ToDo', [[1]], 10, 2000) returns 2000
> matchaddpos('ToDo', [[1]], 10) returns 8
> as same as currently but make them 2 times faster.
> 
> Is there any concerns? How acceptable is it?
> 
> Note that, in this proposal,
> w_next_match_id
> w_manual_match_id_min
> w_manual_match_id_max
> are initialized in clear_matches() and
> when the last id is deleted in match_delete().
> However, I am not sure why, w_next_match_id is not initialzed
> in the latest verison.

Just because it's not needed, since there was the loop to find an
avaialble match ID.

> Is it really necessary to remain those 3 variables even when all cleared?

Nope.

-- 
This is an airconditioned room, do not open Windows.

 /// 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.

Raspunde prin e-mail lui