diff options
author | Rosen Penev <rosenp@gmail.com> | 2020-01-31 21:25:24 -0800 |
---|---|---|
committer | Rosen Penev <rosenp@gmail.com> | 2020-02-01 19:47:47 -0800 |
commit | afb29942b07a2fd217d802495bc4f3f3f320db45 (patch) | |
tree | 44c8985d8be987dbf9b31038f8aa53b2293b6af6 | |
parent | bc6eca2115d8d333eed61d23a01958926bbd7a9c (diff) |
[clang-tidy] simplify boolean expressions
Found with readability-simplify-boolean-expr
Signed-off-by: Rosen Penev <rosenp@gmail.com>
-rw-r--r-- | src/CommandLine.cxx | 2 | ||||
-rw-r--r-- | src/db/plugins/ProxyDatabasePlugin.cxx | 5 | ||||
-rw-r--r-- | src/event/FullyBufferedSocket.cxx | 5 |
3 files changed, 3 insertions, 9 deletions
diff --git a/src/CommandLine.cxx b/src/CommandLine.cxx index 6ea1980e7..cbaaeaa9a 100644 --- a/src/CommandLine.cxx +++ b/src/CommandLine.cxx @@ -283,7 +283,7 @@ static void help(void) "Options:\n"); for (const auto &i : option_defs) - if(i.HasDescription() == true) // hide hidden options from help print + if(i.HasDescription()) // hide hidden options from help print PrintOption(i); exit(EXIT_SUCCESS); diff --git a/src/db/plugins/ProxyDatabasePlugin.cxx b/src/db/plugins/ProxyDatabasePlugin.cxx index c3dfae850..c393fea72 100644 --- a/src/db/plugins/ProxyDatabasePlugin.cxx +++ b/src/db/plugins/ProxyDatabasePlugin.cxx @@ -863,10 +863,7 @@ IsFilterSupported(const ISongFilter &f) noexcept return true; const auto tag = Convert(t->GetTagType()); - if (tag == MPD_TAG_COUNT) - return false; - - return true; + return tag != MPD_TAG_COUNT; } else if (auto u = dynamic_cast<const UriSongFilter *>(&f)) { if (u->IsNegated()) // TODO implement diff --git a/src/event/FullyBufferedSocket.cxx b/src/event/FullyBufferedSocket.cxx index d8ace8a2b..c095229cd 100644 --- a/src/event/FullyBufferedSocket.cxx +++ b/src/event/FullyBufferedSocket.cxx @@ -102,10 +102,7 @@ FullyBufferedSocket::OnSocketReady(unsigned flags) noexcept return false; } - if (!BufferedSocket::OnSocketReady(flags)) - return false; - - return true; + return BufferedSocket::OnSocketReady(flags); } void |