diff src/regexp_bt.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
line wrap: on
line diff
--- a/src/regexp_bt.c
+++ b/src/regexp_bt.c
@@ -4854,17 +4854,7 @@ bt_regexec_multi(
     proftime_T	*tm,		// timeout limit or NULL
     int		*timed_out)	// flag set on timeout or NULL
 {
-    rex.reg_match = NULL;
-    rex.reg_mmatch = rmp;
-    rex.reg_buf = buf;
-    rex.reg_win = win;
-    rex.reg_firstlnum = lnum;
-    rex.reg_maxline = rex.reg_buf->b_ml.ml_line_count - lnum;
-    rex.reg_line_lbr = FALSE;
-    rex.reg_ic = rmp->rmm_ic;
-    rex.reg_icombine = FALSE;
-    rex.reg_maxcol = rmp->rmm_maxcol;
-
+    init_regexec_multi(rmp, win, buf, lnum);
     return bt_regexec_both(NULL, col, tm, timed_out);
 }