]> granicus.if.org Git - clang/commitdiff
Refactor: Simplify boolean conditional return statements in lib/Lex
authorAlexander Kornienko <alexfh@google.com>
Mon, 28 Dec 2015 15:30:42 +0000 (15:30 +0000)
committerAlexander Kornienko <alexfh@google.com>
Mon, 28 Dec 2015 15:30:42 +0000 (15:30 +0000)
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

lib/Lex/PPDirectives.cpp
lib/Lex/PPMacroExpansion.cpp

index 4a03328557945caca66be79a037c6ef3b49cf2d1..c02a0cb8d3024b31c041d65fd85c7a62ae9d7cea 100644 (file)
@@ -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
index 2497e5ec38bcaef781a75432736e4a75febf1f5e..18348df0a39ec0e429702cdbd87e61bdc359f2ff 100644 (file)
@@ -597,9 +597,7 @@ static bool CheckMatchedBrackets(const SmallVectorImpl<Token> &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