aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/runtime.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-01-24 08:43:51 +0800
committerGitHub <noreply@github.com>2023-01-24 08:43:51 +0800
commitfa12b9ca2b1dd5515910875e04fe36564fbaadcc (patch)
treea9db5e808937b47883a341eabda44af00e0df878 /src/nvim/runtime.c
parentdbb6c7f1b8bed789f5bebb73be332c063fc6a604 (diff)
downloadrneovim-fa12b9ca2b1dd5515910875e04fe36564fbaadcc.tar.gz
rneovim-fa12b9ca2b1dd5515910875e04fe36564fbaadcc.tar.bz2
rneovim-fa12b9ca2b1dd5515910875e04fe36564fbaadcc.zip
vim-patch:partial:9.0.1237: code is indented more than necessary (#21971)
Problem: Code is indented more than necessary. Solution: Use an early return where it makes sense. (Yegappan Lakshmanan, closes vim/vim#11858) https://github.com/vim/vim/commit/6ec66660476562e643deceb7c325cd0e8c903663 Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Diffstat (limited to 'src/nvim/runtime.c')
-rw-r--r--src/nvim/runtime.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/nvim/runtime.c b/src/nvim/runtime.c
index 18eb2180d9..24500b80b9 100644
--- a/src/nvim/runtime.c
+++ b/src/nvim/runtime.c
@@ -821,12 +821,14 @@ static void source_all_matches(char *pat)
int num_files;
char **files;
- if (gen_expand_wildcards(1, &pat, &num_files, &files, EW_FILE) == OK) {
- for (int i = 0; i < num_files; i++) {
- (void)do_source(files[i], false, DOSO_NONE);
- }
- FreeWild(num_files, files);
+ if (gen_expand_wildcards(1, &pat, &num_files, &files, EW_FILE) != OK) {
+ return;
+ }
+
+ for (int i = 0; i < num_files; i++) {
+ (void)do_source(files[i], false, DOSO_NONE);
}
+ FreeWild(num_files, files);
}
/// Add the package directory to 'runtimepath'