summaryrefslogtreecommitdiffstats
path: root/Source/cmMachO.cxx
diff options
context:
space:
mode:
authorRegina Pfeifer <regina@mailbox.org>2018-12-13 18:41:05 (GMT)
committerBrad King <brad.king@kitware.com>2019-01-15 16:40:25 (GMT)
commit414aa6c81ec62ab2f728fab31aa189ce674484a4 (patch)
tree0b70c8ae470b1cfebd205af33754bf577c3b277d /Source/cmMachO.cxx
parentd4a42dd4a87c9caa222a7a40150db937258698d2 (diff)
downloadCMake-414aa6c81ec62ab2f728fab31aa189ce674484a4.zip
CMake-414aa6c81ec62ab2f728fab31aa189ce674484a4.tar.gz
CMake-414aa6c81ec62ab2f728fab31aa189ce674484a4.tar.bz2
clang-tidy: Simplify boolean expressions
Diffstat (limited to 'Source/cmMachO.cxx')
-rw-r--r--Source/cmMachO.cxx10
1 files changed, 2 insertions, 8 deletions
diff --git a/Source/cmMachO.cxx b/Source/cmMachO.cxx
index 7294c1c..7368812 100644
--- a/Source/cmMachO.cxx
+++ b/Source/cmMachO.cxx
@@ -52,10 +52,7 @@ bool peek(cmsys::ifstream& fin, T& v)
template <typename T>
bool read(cmsys::ifstream& fin, T& v)
{
- if (!fin.read(reinterpret_cast<char*>(&v), sizeof(T))) {
- return false;
- }
- return true;
+ return !!fin.read(reinterpret_cast<char*>(&v), sizeof(T));
}
// read from the file and fill multiple data structures where
@@ -67,10 +64,7 @@ bool read(cmsys::ifstream& fin, std::vector<T>& v)
if (v.empty()) {
return true;
}
- if (!fin.read(reinterpret_cast<char*>(&v[0]), sizeof(T) * v.size())) {
- return false;
- }
- return true;
+ return !!fin.read(reinterpret_cast<char*>(&v[0]), sizeof(T) * v.size());
}
}