Mercurial > vim
comparison src/regexp_nfa.c @ 19405:08f4dc2ba716 v8.2.0260
patch 8.2.0260: several lines of code are duplicated
Commit: https://github.com/vim/vim/commit/f4140488c72cad4dbf5449dba099cfa7de7bbb22
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Feb 15 23:06:45 2020 +0100
patch 8.2.0260: several lines of code are duplicated
Problem: Several lines of code are duplicated.
Solution: Move duplicated code to a function. (Yegappan Lakshmanan,
closes #5330)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 15 Feb 2020 23:15:04 +0100 |
parents | c62d63d2b9f0 |
children | aadd1cae2ff5 |
comparison
equal
deleted
inserted
replaced
19404:7be3663e2f2b | 19405:08f4dc2ba716 |
---|---|
7407 linenr_T lnum, // nr of line to start looking for match | 7407 linenr_T lnum, // nr of line to start looking for match |
7408 colnr_T col, // column to start looking for match | 7408 colnr_T col, // column to start looking for match |
7409 proftime_T *tm, // timeout limit or NULL | 7409 proftime_T *tm, // timeout limit or NULL |
7410 int *timed_out) // flag set on timeout or NULL | 7410 int *timed_out) // flag set on timeout or NULL |
7411 { | 7411 { |
7412 rex.reg_match = NULL; | 7412 init_regexec_multi(rmp, win, buf, lnum); |
7413 rex.reg_mmatch = rmp; | |
7414 rex.reg_buf = buf; | |
7415 rex.reg_win = win; | |
7416 rex.reg_firstlnum = lnum; | |
7417 rex.reg_maxline = rex.reg_buf->b_ml.ml_line_count - lnum; | |
7418 rex.reg_line_lbr = FALSE; | |
7419 rex.reg_ic = rmp->rmm_ic; | |
7420 rex.reg_icombine = FALSE; | |
7421 rex.reg_maxcol = rmp->rmm_maxcol; | |
7422 | |
7423 return nfa_regexec_both(NULL, col, tm, timed_out); | 7413 return nfa_regexec_both(NULL, col, tm, timed_out); |
7424 } | 7414 } |
7425 | 7415 |
7426 #ifdef DEBUG | 7416 #ifdef DEBUG |
7427 # undef ENABLE_LOG | 7417 # undef ENABLE_LOG |