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/
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 {
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits