diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-04-19 22:49:14 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-19 22:49:14 +0800 |
commit | ea52961c54797fc27e305eb4bb11a5d2c4cdda58 (patch) | |
tree | a2a56b9283ce94998da9bf08073de21df2a28124 /src | |
parent | 0ad5237162a05f0f04c74eab1961166f4f74254b (diff) | |
download | rneovim-ea52961c54797fc27e305eb4bb11a5d2c4cdda58.tar.gz rneovim-ea52961c54797fc27e305eb4bb11a5d2c4cdda58.tar.bz2 rneovim-ea52961c54797fc27e305eb4bb11a5d2c4cdda58.zip |
refactor: fix PVS warnings (#23200)
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/fileio.c | 2 | ||||
-rw-r--r-- | src/nvim/memline.c | 4 | ||||
-rw-r--r-- | src/nvim/option.c | 3 |
3 files changed, 3 insertions, 6 deletions
diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c index 52fafa6a21..bb17382f98 100644 --- a/src/nvim/fileio.c +++ b/src/nvim/fileio.c @@ -3484,7 +3484,7 @@ char *vim_gettempdir(void) static int notfound = 0; bool exists = false; if (vim_tempdir == NULL || !(exists = os_isdir(vim_tempdir))) { - if (vim_tempdir != NULL && !exists) { + if (vim_tempdir != NULL) { notfound++; if (notfound == 1) { ELOG("tempdir disappeared (antivirus or broken cleanup job?): %s", vim_tempdir); diff --git a/src/nvim/memline.c b/src/nvim/memline.c index 2528b5c0d3..cb58cbc86f 100644 --- a/src/nvim/memline.c +++ b/src/nvim/memline.c @@ -1366,9 +1366,7 @@ int recover_names(char *fname, bool do_list, list_T *ret_list, int nr, char **fn } else if (ret_list != NULL) { for (int i = 0; i < num_files; i++) { char *name = concat_fnames(dir_name, files[i], true); - if (name != NULL) { - tv_list_append_allocated_string(ret_list, name); - } + tv_list_append_allocated_string(ret_list, name); } } else { file_count += num_files; diff --git a/src/nvim/option.c b/src/nvim/option.c index 3b674ce726..aff824e9e2 100644 --- a/src/nvim/option.c +++ b/src/nvim/option.c @@ -3257,8 +3257,7 @@ static void showoptions(bool all, int opt_flags) } else { varp = get_varp(p); } - if (varp != NULL - && (all == 1 || (all == 0 && !optval_default(p, varp)))) { + if (varp != NULL && (all || !optval_default(p, varp))) { int len; if (opt_flags & OPT_ONECOLUMN) { len = Columns; |