[PATCH] Refactor: Simplify boolean conditional return statements in lib/Linker
Richard
legalize at xmission.com
Mon May 25 00:04:46 PDT 2015
Hi rafael, void, asl, dexonsmith, resistor, ddunbar,
Use clang-tidy to simplify boolean conditional return statements
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.26401.patch
Type: text/x-patch
Size: 820 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150525/9ce155a8/attachment.bin>
More information about the cfe-commits
mailing list