diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-01-14 21:36:15 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-14 21:36:15 +0800 |
commit | 2065ce877ef81bcd66132bd26e75aa4d761dca12 (patch) | |
tree | 875ab83390eb34fc6d85b5b43c35600166eac56d /src/nvim/eval | |
parent | d549734fb4792bcdb5395006538f7c6d856252e7 (diff) | |
download | rneovim-2065ce877ef81bcd66132bd26e75aa4d761dca12.tar.gz rneovim-2065ce877ef81bcd66132bd26e75aa4d761dca12.tar.bz2 rneovim-2065ce877ef81bcd66132bd26e75aa4d761dca12.zip |
vim-patch:partial:9.0.1196: code is indented more than necessary (#21796)
Problem: Code is indented more than necessary.
Solution: Use an early return where it makes sense. (Yegappan Lakshmanan,
closes vim/vim#11813)
https://github.com/vim/vim/commit/e8575988969579f9e1439181ae338b2ff74054a8
Partial port as this depends on some previous eval and 'smoothscroll'
patches.
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Diffstat (limited to 'src/nvim/eval')
-rw-r--r-- | src/nvim/eval/typval.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/nvim/eval/typval.c b/src/nvim/eval/typval.c index 1de268a9d8..7c61a2f990 100644 --- a/src/nvim/eval/typval.c +++ b/src/nvim/eval/typval.c @@ -326,10 +326,12 @@ void tv_list_free_list(list_T *const l) void tv_list_free(list_T *const l) FUNC_ATTR_NONNULL_ALL { - if (!tv_in_free_unref_items) { - tv_list_free_contents(l); - tv_list_free_list(l); + if (tv_in_free_unref_items) { + return; } + + tv_list_free_contents(l); + tv_list_free_list(l); } /// Unreference a list |