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/CPack/IFW | |
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/CPack/IFW')
-rw-r--r-- | Source/CPack/IFW/cmCPackIFWRepository.cxx | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/Source/CPack/IFW/cmCPackIFWRepository.cxx b/Source/CPack/IFW/cmCPackIFWRepository.cxx index b149f81..1838005 100644 --- a/Source/CPack/IFW/cmCPackIFWRepository.cxx +++ b/Source/CPack/IFW/cmCPackIFWRepository.cxx @@ -45,16 +45,16 @@ bool cmCPackIFWRepository::IsValid() const switch (Update) { case None: - valid = Url.empty() ? false : true; + valid = !Url.empty(); break; case Add: - valid = Url.empty() ? false : true; + valid = !Url.empty(); break; case Remove: - valid = Url.empty() ? false : true; + valid = !Url.empty(); break; case Replace: - valid = (OldUrl.empty() || NewUrl.empty()) ? false : true; + valid = !OldUrl.empty() && !NewUrl.empty(); break; } @@ -244,11 +244,7 @@ bool cmCPackIFWRepository::PatchUpdatesXml() fout.Close(); - if (!cmSystemTools::RenameFile(updatesPatchXml.data(), updatesXml.data())) { - return false; - } - - return true; + return cmSystemTools::RenameFile(updatesPatchXml.data(), updatesXml.data()); } void cmCPackIFWRepository::WriteRepositoryConfig(cmXMLWriter& xout) |