diff options
author | Alexander Kornienko <alexfh@google.com> | 2015-12-28 13:06:58 +0000 |
---|---|---|
committer | Alexander Kornienko <alexfh@google.com> | 2015-12-28 13:06:58 +0000 |
commit | 9c10490efe30ed75d52810c26e83189a96c04926 (patch) | |
tree | 6abcb02d4f5e6aea72eca2429f4c5bf290a8ffc9 /clang/lib/StaticAnalyzer/Checkers/DirectIvarAssignment.cpp | |
parent | fba562004bf8a3c383453791bccbac3aaef7bcf0 (diff) | |
download | bcm5719-llvm-9c10490efe30ed75d52810c26e83189a96c04926.tar.gz bcm5719-llvm-9c10490efe30ed75d52810c26e83189a96c04926.zip |
Refactor: Simplify boolean conditional return statements in lib/StaticAnalyzer/Checkers
Summary: Use clang-tidy to simplify boolean conditional return values
Reviewers: dcoughlin, krememek
Subscribers: krememek, cfe-commits
Patch by Richard Thomson!
Differential Revision: http://reviews.llvm.org/D10021
llvm-svn: 256491
Diffstat (limited to 'clang/lib/StaticAnalyzer/Checkers/DirectIvarAssignment.cpp')
-rw-r--r-- | clang/lib/StaticAnalyzer/Checkers/DirectIvarAssignment.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/clang/lib/StaticAnalyzer/Checkers/DirectIvarAssignment.cpp b/clang/lib/StaticAnalyzer/Checkers/DirectIvarAssignment.cpp index a71def23c0b..ad478cbf782 100644 --- a/clang/lib/StaticAnalyzer/Checkers/DirectIvarAssignment.cpp +++ b/clang/lib/StaticAnalyzer/Checkers/DirectIvarAssignment.cpp @@ -41,13 +41,12 @@ namespace { /// Checks for the init, dealloc, and any other functions that might be allowed /// to perform direct instance variable assignment based on their name. static bool DefaultMethodFilter(const ObjCMethodDecl *M) { - if (M->getMethodFamily() == OMF_init || M->getMethodFamily() == OMF_dealloc || - M->getMethodFamily() == OMF_copy || - M->getMethodFamily() == OMF_mutableCopy || - M->getSelector().getNameForSlot(0).find("init") != StringRef::npos || - M->getSelector().getNameForSlot(0).find("Init") != StringRef::npos) - return true; - return false; + return M->getMethodFamily() == OMF_init || + M->getMethodFamily() == OMF_dealloc || + M->getMethodFamily() == OMF_copy || + M->getMethodFamily() == OMF_mutableCopy || + M->getSelector().getNameForSlot(0).find("init") != StringRef::npos || + M->getSelector().getNameForSlot(0).find("Init") != StringRef::npos; } class DirectIvarAssignment : |