Skip to content

Commit

Permalink
Refactor: Simplify boolean conditional return statements in llvm/lib/…
Browse files Browse the repository at this point in the history
…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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256500 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
alexfh committed Dec 28, 2015
1 parent 651ff52 commit 0062f39
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
5 changes: 1 addition & 4 deletions lib/Support/CommandLine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -345,10 +345,7 @@ static bool CommaSeparateAndAddOccurrence(Option *Handler, unsigned pos,
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 ("")
Expand Down
6 changes: 2 additions & 4 deletions lib/Support/YAMLParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 0062f39

Please sign in to comment.