summaryrefslogtreecommitdiffstats
path: root/src/regexp_nfa.c
diff options
context:
space:
mode:
authorJohn Marriott <basilisk@internode.on.net>2024-05-12 00:07:17 +0200
committerChristian Brabandt <cb@256bit.org>2024-05-12 00:07:17 +0200
commit82792db6315f7c7b0e299cdde1566f2932a463f8 (patch)
tree1c737947e930d407f6ebdb2d07d08e14df96e560 /src/regexp_nfa.c
parent86f6e2c2eed7df2bf5c60cc74d08d7a8d3c75f45 (diff)
patch 9.1.0409: too many strlen() calls in the regexp enginev9.1.0409
Problem: too many strlen() calls in the regexp engine Solution: refactor code to retrieve strlen differently, make use of bsearch() for getting the character class (John Marriott) closes: #14648 Signed-off-by: John Marriott <basilisk@internode.on.net> Signed-off-by: Christian Brabandt <cb@256bit.org>
Diffstat (limited to 'src/regexp_nfa.c')
-rw-r--r--src/regexp_nfa.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/regexp_nfa.c b/src/regexp_nfa.c
index 5e4fadd028..4f07a21d5d 100644
--- a/src/regexp_nfa.c
+++ b/src/regexp_nfa.c
@@ -5387,7 +5387,7 @@ recursive_regmatch(
rex.input = rex.line;
}
else
- rex.input = rex.line + STRLEN(rex.line);
+ rex.input = rex.line + reg_getline_len(rex.lnum);
}
if ((int)(rex.input - rex.line) >= state->val)
{
@@ -6937,8 +6937,7 @@ nfa_regmatch(
{
colnr_T pos_col = pos->lnum == rex.lnum + rex.reg_firstlnum
&& pos->col == MAXCOL
- ? (colnr_T)STRLEN(reg_getline(
- pos->lnum - rex.reg_firstlnum))
+ ? reg_getline_len(pos->lnum - rex.reg_firstlnum)
: pos->col;
result = (pos->lnum == rex.lnum + rex.reg_firstlnum