From 7c36b8871ac0cd976461b19b8d302ba58121fbfd Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Tue, 2 Jun 2020 18:23:54 -0700 Subject: [PATCH] [clang-tidy] simplify boolean expression Found with readability-simplify-boolean-expr Signed-off-by: Rosen Penev --- .clang-tidy | 2 ++ src/manifest_parser.cc | 5 +---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index df4c1ed..54f579b 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -4,10 +4,12 @@ Checks: ' ,readability-non-const-parameter, ,readability-redundant-string-cstr, ,readability-redundant-string-init, + ,readability-simplify-boolean-expr, ' WarningsAsErrors: ' ,readability-avoid-const-params-in-decls, ,readability-non-const-parameter, ,readability-redundant-string-cstr, ,readability-redundant-string-init, + ,readability-simplify-boolean-expr, ' diff --git a/src/manifest_parser.cc b/src/manifest_parser.cc index 860a8fc..54ad3f4 100644 --- a/src/manifest_parser.cc +++ b/src/manifest_parser.cc @@ -202,10 +202,7 @@ bool ManifestParser::ParseDefault(string* err) { return false; } while (!eval.empty()); - if (!ExpectToken(Lexer::NEWLINE, err)) - return false; - - return true; + return ExpectToken(Lexer::NEWLINE, err); } bool ManifestParser::ParseEdge(string* err) {