[PATCH] Refactor: Simplify boolean conditional return statements in lib/Transforms/ObjCARC

Richard legalize at xmission.com
Mon May 25 11:15:54 PDT 2015


Hi craig.topper, gottesmm, bkramer, chandlerc,

Use clang-tidy to simplify boolean conditional return statements

http://reviews.llvm.org/D9999

Files:
  lib/Transforms/ObjCARC/ObjCARCOpts.cpp

Index: lib/Transforms/ObjCARC/ObjCARCOpts.cpp
===================================================================
--- lib/Transforms/ObjCARC/ObjCARCOpts.cpp
+++ lib/Transforms/ObjCARC/ObjCARCOpts.cpp
@@ -2008,10 +2008,7 @@
 
   // Check that the call is a regular call.
   ARCInstKind Class = GetBasicARCInstKind(Call);
-  if (Class != ARCInstKind::CallOrUser && Class != ARCInstKind::Call)
-    return false;
-
-  return true;
+  return Class == ARCInstKind::CallOrUser || Class == ARCInstKind::Call;
 }
 
 /// Find a dependent retain that precedes the given autorelease for which there

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D9999.26463.patch
Type: text/x-patch
Size: 588 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150525/3c38eec9/attachment.bin>


More information about the llvm-commits mailing list