[PATCH] D9978: Refactor: Simplify boolean conditional return statements in llvm/lib/Support

Richard via llvm-commits llvm-commits at lists.llvm.org
Sat Oct 24 13:42:13 PDT 2015


LegalizeAdulthood updated this revision to Diff 38327.
LegalizeAdulthood added a comment.

Update from latest.
I do not have commit access.


http://reviews.llvm.org/D9978

Files:
  lib/Support/CommandLine.cpp
  lib/Support/YAMLParser.cpp

Index: lib/Support/YAMLParser.cpp
===================================================================
--- lib/Support/YAMLParser.cpp
+++ lib/Support/YAMLParser.cpp
@@ -962,10 +962,8 @@
 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() {
Index: lib/Support/CommandLine.cpp
===================================================================
--- lib/Support/CommandLine.cpp
+++ lib/Support/CommandLine.cpp
@@ -346,10 +346,7 @@
     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 ("")


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D9978.38327.patch
Type: text/x-patch
Size: 1036 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151024/1c3eff2d/attachment.bin>


More information about the llvm-commits mailing list