From: Alexander Kornienko Date: Mon, 28 Dec 2015 15:30:42 +0000 (+0000) Subject: Refactor: Simplify boolean conditional return statements in lib/Lex X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=dcd00da6a075ff210bfead60d134d692501e85ee;p=clang Refactor: Simplify boolean conditional return statements in lib/Lex Summary: Use clang-tidy to simplify boolean conditional return statements Reviewers: dblaikie Subscribers: dblaikie, cfe-commits Patch by Richard Thomson! Differential Revision: http://reviews.llvm.org/D10017 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@256499 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Lex/PPDirectives.cpp b/lib/Lex/PPDirectives.cpp index 4a03328557..c02a0cb8d3 100644 --- a/lib/Lex/PPDirectives.cpp +++ b/lib/Lex/PPDirectives.cpp @@ -2043,13 +2043,9 @@ static bool isConfigurationPattern(Token &MacroName, MacroInfo *MI, } // #define inline - if (MacroName.isOneOf(tok::kw_extern, tok::kw_inline, tok::kw_static, - tok::kw_const) && - MI->getNumTokens() == 0) { - return true; - } - - return false; + return MacroName.isOneOf(tok::kw_extern, tok::kw_inline, tok::kw_static, + tok::kw_const) && + MI->getNumTokens() == 0; } /// HandleDefineDirective - Implements \#define. This consumes the entire macro diff --git a/lib/Lex/PPMacroExpansion.cpp b/lib/Lex/PPMacroExpansion.cpp index 2497e5ec38..18348df0a3 100644 --- a/lib/Lex/PPMacroExpansion.cpp +++ b/lib/Lex/PPMacroExpansion.cpp @@ -597,9 +597,7 @@ static bool CheckMatchedBrackets(const SmallVectorImpl &Tokens) { Brackets.pop_back(); } } - if (!Brackets.empty()) - return false; - return true; + return Brackets.empty(); } /// GenerateNewArgTokens - Returns true if OldTokens can be converted to a new