diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2017-05-08 13:45:14 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-08 13:45:14 +0200 |
commit | a9605bb4aff76a934a4c39fbda093ee8fc8a1c71 (patch) | |
tree | 47dbb30254735b7184442eb9ab290659259b9635 /src/nvim/regexp_nfa.c | |
parent | 631d55ada04bfeaedabb5bf43092457c5f78b8a5 (diff) | |
parent | 22fb9d8d25f5354bb878b953ba49b439961c8476 (diff) | |
download | rneovim-a9605bb4aff76a934a4c39fbda093ee8fc8a1c71.tar.gz rneovim-a9605bb4aff76a934a4c39fbda093ee8fc8a1c71.tar.bz2 rneovim-a9605bb4aff76a934a4c39fbda093ee8fc8a1c71.zip |
Merge #6460 from ZyX-I/1476-changes
Refactor functions which find character in a string
Diffstat (limited to 'src/nvim/regexp_nfa.c')
-rw-r--r-- | src/nvim/regexp_nfa.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/src/nvim/regexp_nfa.c b/src/nvim/regexp_nfa.c index 139772d51e..85fae9d82e 100644 --- a/src/nvim/regexp_nfa.c +++ b/src/nvim/regexp_nfa.c @@ -4855,17 +4855,10 @@ static int failure_chance(nfa_state_T *state, int depth) */ static int skip_to_start(int c, colnr_T *colp) { - char_u *s; - - /* Used often, do some work to avoid call overhead. */ - if (!ireg_ic - && !has_mbyte - ) - s = vim_strbyte(regline + *colp, c); - else - s = cstrchr(regline + *colp, c); - if (s == NULL) + const char_u *const s = cstrchr(regline + *colp, c); + if (s == NULL) { return FAIL; + } *colp = (int)(s - regline); return OK; } |