diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-01-09 07:16:36 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-09 07:16:36 +0800 |
commit | a174f4e53f0e111653e10d2df8aebe7c9fa0f73e (patch) | |
tree | f1f8edde414073608020399de66518162ca6ad56 /src/nvim/file_search.c | |
parent | 904c13e6b572552a676efcaec640dfa8bd199e59 (diff) | |
download | rneovim-a174f4e53f0e111653e10d2df8aebe7c9fa0f73e.tar.gz rneovim-a174f4e53f0e111653e10d2df8aebe7c9fa0f73e.tar.bz2 rneovim-a174f4e53f0e111653e10d2df8aebe7c9fa0f73e.zip |
vim-patch:9.0.1158: code is indented more than necessary (#21697)
Problem: Code is indented more than necessary.
Solution: Use an early return where it makes sense. (Yegappan Lakshmanan,
closes vim/vim#11787)
https://github.com/vim/vim/commit/7f8b2559a30e2e2a443c35b28e94c6b45ba7ae04
Omit reset_last_used_map(): only used in Vim9 script.
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Diffstat (limited to 'src/nvim/file_search.c')
-rw-r--r-- | src/nvim/file_search.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/nvim/file_search.c b/src/nvim/file_search.c index 47f2e44c39..32d7c52749 100644 --- a/src/nvim/file_search.c +++ b/src/nvim/file_search.c @@ -1150,10 +1150,12 @@ static void ff_push(ff_search_ctx_T *search_ctx, ff_stack_T *stack_ptr) { // check for NULL pointer, not to return an error to the user, but // to prevent a crash - if (stack_ptr != NULL) { - stack_ptr->ffs_prev = search_ctx->ffsc_stack_ptr; - search_ctx->ffsc_stack_ptr = stack_ptr; + if (stack_ptr == NULL) { + return; } + + stack_ptr->ffs_prev = search_ctx->ffsc_stack_ptr; + search_ctx->ffsc_stack_ptr = stack_ptr; } /// Pop a dir from the directory stack. |