[PATCH] D10017: Refactor: Simplify boolean conditional return statements in lib/Lex

Alexander Kornienko via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 28 07:34:11 PST 2015


This revision was automatically updated to reflect the committed changes.
Closed by commit rL256499: Refactor: Simplify boolean conditional return statements in lib/Lex (authored by alexfh).

Changed prior to commit:
  http://reviews.llvm.org/D10017?vs=38322&id=43693#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D10017

Files:
  cfe/trunk/lib/Lex/PPDirectives.cpp
  cfe/trunk/lib/Lex/PPMacroExpansion.cpp

Index: cfe/trunk/lib/Lex/PPDirectives.cpp
===================================================================
--- cfe/trunk/lib/Lex/PPDirectives.cpp
+++ cfe/trunk/lib/Lex/PPDirectives.cpp
@@ -2043,13 +2043,9 @@
   }
 
   // #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: cfe/trunk/lib/Lex/PPMacroExpansion.cpp
===================================================================
--- cfe/trunk/lib/Lex/PPMacroExpansion.cpp
+++ cfe/trunk/lib/Lex/PPMacroExpansion.cpp
@@ -597,9 +597,7 @@
       Brackets.pop_back();
     }
   }
-  if (!Brackets.empty())
-    return false;
-  return true;
+  return Brackets.empty();
 }
 
 /// GenerateNewArgTokens - Returns true if OldTokens can be converted to a new


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D10017.43693.patch
Type: text/x-patch
Size: 1109 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20151228/d17b5d24/attachment-0001.bin>


More information about the cfe-commits mailing list