[llvm] r256500 - Refactor: Simplify boolean conditional return statements in llvm/lib/Support
Alexander Kornienko via llvm-commits
llvm-commits at lists.llvm.org
Mon Dec 28 07:46:15 PST 2015
Author: alexfh
Date: Mon Dec 28 09:46:15 2015
New Revision: 256500
URL: http://llvm.org/viewvc/llvm-project?rev=256500&view=rev
Log:
Refactor: Simplify boolean conditional return statements in llvm/lib/Support
Summary: Use clang-tidy to simplify boolean conditional return statements
Reviewers: rafael, bkramer, ddunbar, Bigcheese, chandlerc, chapuni, nicholas, alexfh
Subscribers: alexfh, craig.topper, llvm-commits
Patch by Richard Thomson!
Differential Revision: http://reviews.llvm.org/D9978
Modified:
llvm/trunk/lib/Support/CommandLine.cpp
llvm/trunk/lib/Support/YAMLParser.cpp
Modified: llvm/trunk/lib/Support/CommandLine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/CommandLine.cpp?rev=256500&r1=256499&r2=256500&view=diff
==============================================================================
--- llvm/trunk/lib/Support/CommandLine.cpp (original)
+++ llvm/trunk/lib/Support/CommandLine.cpp Mon Dec 28 09:46:15 2015
@@ -345,10 +345,7 @@ static bool CommaSeparateAndAddOccurrenc
Value = Val;
}
- if (Handler->addOccurrence(pos, ArgName, Value, MultiArg))
- return true;
-
- return false;
+ return Handler->addOccurrence(pos, ArgName, Value, MultiArg);
}
/// ProvideOption - For Value, this differentiates between an empty value ("")
Modified: llvm/trunk/lib/Support/YAMLParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/YAMLParser.cpp?rev=256500&r1=256499&r2=256500&view=diff
==============================================================================
--- llvm/trunk/lib/Support/YAMLParser.cpp (original)
+++ llvm/trunk/lib/Support/YAMLParser.cpp Mon Dec 28 09:46:15 2015
@@ -962,10 +962,8 @@ void Scanner::skip(uint32_t Distance) {
bool Scanner::isBlankOrBreak(StringRef::iterator Position) {
if (Position == End)
return false;
- if ( *Position == ' ' || *Position == '\t'
- || *Position == '\r' || *Position == '\n')
- return true;
- return false;
+ return *Position == ' ' || *Position == '\t' || *Position == '\r' ||
+ *Position == '\n';
}
bool Scanner::consumeLineBreakIfPresent() {
More information about the llvm-commits
mailing list