Mercurial > vim
comparison src/regexp.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 | 6c944fee0d7e |
children | 5feb426d2ea1 |
comparison
equal
deleted
inserted
replaced
19404:7be3663e2f2b | 19405:08f4dc2ba716 |
---|---|
2509 } | 2509 } |
2510 return list; | 2510 return list; |
2511 } | 2511 } |
2512 #endif | 2512 #endif |
2513 | 2513 |
2514 /* | |
2515 * Initialize the values used for matching against multiple lines | |
2516 */ | |
2517 static void | |
2518 init_regexec_multi( | |
2519 regmmatch_T *rmp, | |
2520 win_T *win, // window in which to search or NULL | |
2521 buf_T *buf, // buffer in which to search | |
2522 linenr_T lnum) // nr of line to start looking for match | |
2523 { | |
2524 rex.reg_match = NULL; | |
2525 rex.reg_mmatch = rmp; | |
2526 rex.reg_buf = buf; | |
2527 rex.reg_win = win; | |
2528 rex.reg_firstlnum = lnum; | |
2529 rex.reg_maxline = rex.reg_buf->b_ml.ml_line_count - lnum; | |
2530 rex.reg_line_lbr = FALSE; | |
2531 rex.reg_ic = rmp->rmm_ic; | |
2532 rex.reg_icombine = FALSE; | |
2533 rex.reg_maxcol = rmp->rmm_maxcol; | |
2534 } | |
2535 | |
2514 #include "regexp_bt.c" | 2536 #include "regexp_bt.c" |
2515 | 2537 |
2516 static regengine_T bt_regengine = | 2538 static regengine_T bt_regengine = |
2517 { | 2539 { |
2518 bt_regcomp, | 2540 bt_regcomp, |