Hi alexfh,
Use clang-tidy to simplify boolean conditional return statements
http://reviews.llvm.org/D10026
Files:
clang-modernize/UseNullptr/NullptrActions.cpp
Index: clang-modernize/UseNullptr/NullptrActions.cpp
===================================================================
--- clang-modernize/UseNullptr/NullptrActions.cpp
+++ clang-modernize/UseNullptr/NullptrActions.cpp
@@ -256,10 +256,7 @@
else
llvm_unreachable("Unhandled ContainingAncestor node type");
- if (ArgUsageVisitor.foundInvalid())
- return false;
-
- return true;
+ return !ArgUsageVisitor.foundInvalid();
}
/// \brief Given the SourceLocation for a macro arg expansion, finds the
@@ -339,10 +336,7 @@
if (!Expansion.isMacroArgExpansion()) {
if (Loc.isFileID()) {
- if (Loc == TestMacroLoc)
- // Match made.
- return true;
- return false;
+ return Loc == TestMacroLoc;
}
// Since Loc is still a macro ID and it's not an argument expansion, we
// don't need to do the work of handling an argument expansion. Simply
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
Index: clang-modernize/UseNullptr/NullptrActions.cpp
===================================================================
--- clang-modernize/UseNullptr/NullptrActions.cpp
+++ clang-modernize/UseNullptr/NullptrActions.cpp
@@ -256,10 +256,7 @@
else
llvm_unreachable("Unhandled ContainingAncestor node type");
- if (ArgUsageVisitor.foundInvalid())
- return false;
-
- return true;
+ return !ArgUsageVisitor.foundInvalid();
}
/// \brief Given the SourceLocation for a macro arg expansion, finds the
@@ -339,10 +336,7 @@
if (!Expansion.isMacroArgExpansion()) {
if (Loc.isFileID()) {
- if (Loc == TestMacroLoc)
- // Match made.
- return true;
- return false;
+ return Loc == TestMacroLoc;
}
// Since Loc is still a macro ID and it's not an argument expansion, we
// don't need to do the work of handling an argument expansion. Simply
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits