clang-tidy: readability-simplify-boolean-expr (#4639)

This commit is contained in:
Eisuke Kawashima
2022-03-17 21:50:50 +09:00
committed by GitHub
parent 2d7eb89ffc
commit ba6d8e0d3b
41 changed files with 130 additions and 288 deletions

View File

@@ -62,11 +62,7 @@ bool SparseBitVect::operator[](const unsigned int which) const {
if (which >= d_size) {
throw IndexErrorException(which);
}
if (dp_bits->count(which)) {
return true;
} else {
return false;
}
return dp_bits->count(which) > 0u;
}
// """ -------------------------------------------------------
@@ -157,11 +153,7 @@ bool SparseBitVect::getBit(const unsigned int which) const {
if (which >= d_size) {
throw IndexErrorException(which);
}
if (dp_bits->count(which)) {
return true;
} else {
return false;
}
return dp_bits->count(which) > 0u;
}
// """ -------------------------------------------------------
@@ -174,11 +166,7 @@ bool SparseBitVect::getBit(const IntVectIter which) const {
if (*which < 0 || static_cast<unsigned int>(*which) >= d_size) {
throw IndexErrorException(*which);
}
if (dp_bits->count(*which)) {
return true;
} else {
return false;
}
return dp_bits->count(*which) > 0u;
}
// """ -------------------------------------------------------
@@ -191,11 +179,7 @@ bool SparseBitVect::getBit(const IntSetIter which) const {
if (*which < 0 || static_cast<unsigned int>(*which) >= d_size) {
throw IndexErrorException(*which);
}
if (dp_bits->count(*which)) {
return true;
} else {
return false;
}
return dp_bits->count(*which) > 0u;
}
// """ -------------------------------------------------------