r256499 - Refactor: Simplify boolean conditional return statements in lib/Lex
Alexander Kornienko via cfe-commits
cfe-commits at lists.llvm.org
Mon Dec 28 07:30:42 PST 2015
Author: alexfh
Date: Mon Dec 28 09:30:42 2015
New Revision: 256499
URL: http://llvm.org/viewvc/llvm-project?rev=256499&view=rev
Log:
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
Modified:
cfe/trunk/lib/Lex/PPDirectives.cpp
cfe/trunk/lib/Lex/PPMacroExpansion.cpp
Modified: cfe/trunk/lib/Lex/PPDirectives.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/PPDirectives.cpp?rev=256499&r1=256498&r2=256499&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/PPDirectives.cpp (original)
+++ cfe/trunk/lib/Lex/PPDirectives.cpp Mon Dec 28 09:30:42 2015
@@ -2043,13 +2043,9 @@ static bool isConfigurationPattern(Token
}
// #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
Modified: cfe/trunk/lib/Lex/PPMacroExpansion.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/PPMacroExpansion.cpp?rev=256499&r1=256498&r2=256499&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/PPMacroExpansion.cpp (original)
+++ cfe/trunk/lib/Lex/PPMacroExpansion.cpp Mon Dec 28 09:30:42 2015
@@ -597,9 +597,7 @@ static bool CheckMatchedBrackets(const S
Brackets.pop_back();
}
}
- if (!Brackets.empty())
- return false;
- return true;
+ return Brackets.empty();
}
/// GenerateNewArgTokens - Returns true if OldTokens can be converted to a new
More information about the cfe-commits
mailing list