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

Richard legalize at xmission.com
Mon May 25 08:31:30 PDT 2015


Update from comments


http://reviews.llvm.org/D9975

Files:
  lib/Linker/LinkModules.cpp

Index: lib/Linker/LinkModules.cpp
===================================================================
--- lib/Linker/LinkModules.cpp
+++ lib/Linker/LinkModules.cpp
@@ -545,9 +545,7 @@
     return true;
   if (a == GlobalValue::ProtectedVisibility)
     return false;
-  if (b == GlobalValue::ProtectedVisibility)
-    return true;
-  return false;
+  return b == GlobalValue::ProtectedVisibility;
 }
 
 /// Loop through the global variables in the src module and merge them into the
@@ -1643,9 +1641,7 @@
 bool Linker::StructTypeKeyInfo::KeyTy::operator==(const KeyTy &That) const {
   if (IsPacked != That.IsPacked)
     return false;
-  if (ETypes != That.ETypes)
-    return false;
-  return true;
+  return ETypes == That.ETypes;
 }
 
 bool Linker::StructTypeKeyInfo::KeyTy::operator!=(const KeyTy &That) const {

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D9975.26438.patch
Type: text/x-patch
Size: 817 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150525/18b973a9/attachment.bin>


More information about the cfe-commits mailing list