diff options
author | Daniel Pfeifer <daniel@pfeifer-mail.de> | 2016-06-01 21:29:53 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-06-02 12:24:04 (GMT) |
commit | 7f6b8d3399dd841b0d29bf74d2b31021738c4ef8 (patch) | |
tree | 9b9184028cba2f16fdcc1c10ac5fb5467f09bff7 /Source/cmMakefile.cxx | |
parent | d6754d37d593a0189809dcf98bc4fdf3a609f0a3 (diff) | |
download | CMake-7f6b8d3399dd841b0d29bf74d2b31021738c4ef8.zip CMake-7f6b8d3399dd841b0d29bf74d2b31021738c4ef8.tar.gz CMake-7f6b8d3399dd841b0d29bf74d2b31021738c4ef8.tar.bz2 |
Simplify boolean expressions
Use clang-tidy's readability-simplify-boolean-expr checker.
After applying the fix-its, revise all changes *very* carefully.
Be aware of false positives and invalid changes.
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r-- | Source/cmMakefile.cxx | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index e684689..45fb7cf 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -2124,20 +2124,11 @@ bool cmMakefile::CanIWriteThisFile(const char* fileName) const // If we are doing an in-source build, then the test will always fail if (cmSystemTools::SameFile(this->GetHomeDirectory(), this->GetHomeOutputDirectory())) { - if (this->IsOn("CMAKE_DISABLE_IN_SOURCE_BUILD")) { - return false; - } - return true; + return !this->IsOn("CMAKE_DISABLE_IN_SOURCE_BUILD"); } - // Check if this is a subdirectory of the source tree but not a - // subdirectory of the build tree - if (cmSystemTools::IsSubDirectory(fileName, this->GetHomeDirectory()) && - !cmSystemTools::IsSubDirectory(fileName, - this->GetHomeOutputDirectory())) { - return false; - } - return true; + return !cmSystemTools::IsSubDirectory(fileName, this->GetHomeDirectory()) || + cmSystemTools::IsSubDirectory(fileName, this->GetHomeOutputDirectory()); } const char* cmMakefile::GetRequiredDefinition(const std::string& name) const @@ -2166,7 +2157,7 @@ bool cmMakefile::IsDefinitionSet(const std::string& name) const } } #endif - return def ? true : false; + return def != NULL; } const char* cmMakefile::GetDefinition(const std::string& name) const |