run clang-tidy with readability-braces-around-statements (#2899)

* run clang-tidy with readability-braces-around-statements
clang-format the results
clean up all the parts that clang-tidy-8 broke

* fix problem on windows
This commit is contained in:
Greg Landrum
2020-01-25 14:19:32 +01:00
committed by GitHub
parent fb3cad523e
commit d41752d558
261 changed files with 7449 additions and 3545 deletions

View File

@@ -52,7 +52,9 @@ ExplicitBitVect::ExplicitBitVect(const ExplicitBitVect &other)
};
ExplicitBitVect &ExplicitBitVect::operator=(const ExplicitBitVect &other) {
if (this == &other) return *this;
if (this == &other) {
return *this;
}
d_size = other.d_size;
delete dp_bits;
dp_bits = new boost::dynamic_bitset<>(*(other.dp_bits));
@@ -169,10 +171,14 @@ unsigned int ExplicitBitVect::getNumOffBits() const {
// the contents of v are blown out
void ExplicitBitVect::getOnBits(IntVect &v) const {
unsigned int nOn = getNumOnBits();
if (!v.empty()) IntVect().swap(v);
if (!v.empty()) {
IntVect().swap(v);
}
v.reserve(nOn);
for (unsigned int i = 0; i < d_size; i++) {
if ((bool)(*dp_bits)[i]) v.push_back(i);
if ((bool)(*dp_bits)[i]) {
v.push_back(i);
}
}
};