diff options
author | Lewis Russell <lewis6991@gmail.com> | 2023-01-30 13:02:50 +0000 |
---|---|---|
committer | Lewis Russell <lewis6991@gmail.com> | 2023-01-31 11:20:34 +0000 |
commit | b7d09695c4107bfbe03e9755f22e65027a8b18c2 (patch) | |
tree | 0768edc89a23d1880b514d1dd21107e06d5d206d | |
parent | b649a96fc09fa7f18a988b0b0be5dadb54ad49de (diff) | |
download | rneovim-b7d09695c4107bfbe03e9755f22e65027a8b18c2.tar.gz rneovim-b7d09695c4107bfbe03e9755f22e65027a8b18c2.tar.bz2 rneovim-b7d09695c4107bfbe03e9755f22e65027a8b18c2.zip |
refactor(fileio.c): refactor match_file_path()
-rw-r--r-- | src/nvim/fileio.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c index fbb5c4f1fa..6bd1655ebc 100644 --- a/src/nvim/fileio.c +++ b/src/nvim/fileio.c @@ -5363,13 +5363,7 @@ bool match_file_pat(char *pattern, regprog_T **prog, char *fname, char *sfname, bool result = false; regmatch.rm_ic = p_fic; // ignore case if 'fileignorecase' is set - { - if (prog != NULL) { - regmatch.regprog = *prog; - } else { - regmatch.regprog = vim_regcomp(pattern, RE_MAGIC); - } - } + regmatch.regprog = prog != NULL ? *prog : vim_regcomp(pattern, RE_MAGIC); // Try for a match with the pattern with: // 1. the full file name, when the pattern has a '/'. |