From 4a2aed1f8e629265af2c4250b7d5a633f263ddfb Mon Sep 17 00:00:00 2001 From: Kurtis Rader Date: Fri, 28 Oct 2016 17:42:50 -0700 Subject: [PATCH] lint: unnecessary else statement --- src/autoload.cpp | 4 ++-- src/builtin.cpp | 10 +++++----- src/function.cpp | 4 ++-- src/path.cpp | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/autoload.cpp b/src/autoload.cpp index 37ca2b8f1..d97352b02 100644 --- a/src/autoload.cpp +++ b/src/autoload.cpp @@ -313,7 +313,7 @@ bool autoload_t::locate_file_and_maybe_load_it(const wcstring &cmd, bool really_ if (really_load) { return reloaded; - } else { - return found_file || has_script_source; } + + return found_file || has_script_source; } diff --git a/src/builtin.cpp b/src/builtin.cpp index 5902a79c9..7efd57e3b 100644 --- a/src/builtin.cpp +++ b/src/builtin.cpp @@ -1886,12 +1886,12 @@ static int builtin_read(parser_t &parser, io_streams_t &streams, wchar_t **argv) argv[0], w.woptarg); builtin_print_help(parser, streams, argv[0], streams.err); return STATUS_BUILTIN_ERROR; - } else { - streams.err.append_format(_(L"%ls: Argument '%ls' must be an integer\n"), - argv[0], w.woptarg); - builtin_print_help(parser, streams, argv[0], streams.err); - return STATUS_BUILTIN_ERROR; } + + streams.err.append_format(_(L"%ls: Argument '%ls' must be an integer\n"), + argv[0], w.woptarg); + builtin_print_help(parser, streams, argv[0], streams.err); + return STATUS_BUILTIN_ERROR; } break; } diff --git a/src/function.cpp b/src/function.cpp index ffd117d5e..3f303a468 100644 --- a/src/function.cpp +++ b/src/function.cpp @@ -272,9 +272,9 @@ bool function_get_desc(const wcstring &name, wcstring *out_desc) { if (out_desc && func && !func->description.empty()) { out_desc->assign(_(func->description.c_str())); return true; - } else { - return false; } + + return false; } void function_set_desc(const wcstring &name, const wcstring &desc) { diff --git a/src/path.cpp b/src/path.cpp index 2e83b8bb4..f9551d3b9 100644 --- a/src/path.cpp +++ b/src/path.cpp @@ -370,7 +370,7 @@ bool paths_are_same_file(const wcstring &path1, const wcstring &path2) { struct stat s1, s2; if (wstat(path1, &s1) == 0 && wstat(path2, &s2) == 0) { return s1.st_ino == s2.st_ino && s1.st_dev == s2.st_dev; - } else { - return false; } + + return false; }