diff options
author | bfredl <bjorn.linse@gmail.com> | 2022-11-08 09:48:48 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-08 09:48:48 +0100 |
commit | fae754073289566051433fae74ec65783f9e7a6a (patch) | |
tree | 27fa3555e5a8a016dce55cc39f20599e32cf7046 /src/nvim/os | |
parent | d187c00faf4feb76bdc544b87bea71f217d05957 (diff) | |
parent | 731cdde28ea8d48cc23ba2752a08c261c87eee92 (diff) | |
download | rneovim-fae754073289566051433fae74ec65783f9e7a6a.tar.gz rneovim-fae754073289566051433fae74ec65783f9e7a6a.tar.bz2 rneovim-fae754073289566051433fae74ec65783f9e7a6a.zip |
Merge pull request #20821 from dundargoc/refactor/clang-tidy
refactor: fix clang-tidy warnings
Diffstat (limited to 'src/nvim/os')
-rw-r--r-- | src/nvim/os/env.c | 12 | ||||
-rw-r--r-- | src/nvim/os/fs.c | 9 | ||||
-rw-r--r-- | src/nvim/os/input.c | 3 |
3 files changed, 9 insertions, 15 deletions
diff --git a/src/nvim/os/env.c b/src/nvim/os/env.c index faafc546a4..ca6bff662d 100644 --- a/src/nvim/os/env.c +++ b/src/nvim/os/env.c @@ -837,10 +837,9 @@ const void *vim_env_iter(const char delim, const char *const val, const void *co if (dirend == NULL) { *len = strlen(varval); return NULL; - } else { - *len = (size_t)(dirend - varval); - return dirend + 1; } + *len = (size_t)(dirend - varval); + return dirend + 1; } /// Iterates $PATH-like delimited list `val` in reverse order. @@ -870,11 +869,10 @@ const void *vim_env_iter_rev(const char delim, const char *const val, const void *len = varlen; *dir = val; return NULL; - } else { - *dir = colon + 1; - *len = (size_t)(varend - colon); - return colon - 1; } + *dir = colon + 1; + *len = (size_t)(varend - colon); + return colon - 1; } /// @param[out] exe_name should be at least MAXPATHL in size diff --git a/src/nvim/os/fs.c b/src/nvim/os/fs.c index 3c9578979e..0cadabbb47 100644 --- a/src/nvim/os/fs.c +++ b/src/nvim/os/fs.c @@ -121,9 +121,8 @@ bool os_isrealdir(const char *name) fs_loop_unlock(); if (S_ISLNK(request.statbuf.st_mode)) { return false; - } else { - return S_ISDIR(request.statbuf.st_mode); } + return S_ISDIR(request.statbuf.st_mode); } /// Check if the given path exists and is a directory. @@ -249,9 +248,8 @@ bool os_can_exe(const char *name, char **abspath, bool use_path) && is_executable(name, abspath)) { #endif return true; - } else { - return false; } + return false; } return is_executable_in_path(name, abspath); @@ -756,9 +754,8 @@ int32_t os_getperm(const char *name) int stat_result = os_stat(name, &statbuf); if (stat_result == kLibuvSuccess) { return (int32_t)statbuf.st_mode; - } else { - return stat_result; } + return stat_result; } /// Set the permission of a file. diff --git a/src/nvim/os/input.c b/src/nvim/os/input.c index cb0dba8cac..f8c1ee57ea 100644 --- a/src/nvim/os/input.c +++ b/src/nvim/os/input.c @@ -469,9 +469,8 @@ static InbufPollResult inbuf_poll(int ms, MultiQueue *events) if (input_ready(events)) { return kInputAvail; - } else { - return input_eof ? kInputEof : kInputNone; } + return input_eof ? kInputEof : kInputNone; } void input_done(void) |