Merge pull request #263 from gtsoul-tech/bug/cppcheck-61

Cppcheck knownConditionTrueFalse error
This commit is contained in:
Konstantinos Margaritis
2024-05-02 16:50:16 +03:00
committed by GitHub
10 changed files with 32 additions and 62 deletions

View File

@@ -154,7 +154,7 @@ TEST_P(FDRFloodp, NoMask) {
struct hs_scratch scratch;
scratch.fdr_conf = NULL;
while (1) {
while (c != 255) {
SCOPED_TRACE((unsigned int)c);
u8 bit = 1 << (c & 0x7);
u8 cAlt = c ^ bit;
@@ -233,9 +233,7 @@ TEST_P(FDRFloodp, NoMask) {
}
matchesCounts.clear();
if (++c == 0) {
break;
}
++c;
}
}
@@ -248,7 +246,7 @@ TEST_P(FDRFloodp, WithMask) {
struct hs_scratch scratch;
scratch.fdr_conf = NULL;
while (1) {
while (c != 255) {
u8 bit = 1 << (c & 0x7);
u8 cAlt = c ^ bit;
SCOPED_TRACE((unsigned int)c);
@@ -396,9 +394,7 @@ TEST_P(FDRFloodp, WithMask) {
}
matchesCounts.clear();
if (++c == '\0') {
break;
}
++c;
}
}
@@ -414,7 +410,7 @@ TEST_P(FDRFloodp, StreamingMask) {
struct hs_scratch scratch;
scratch.fdr_conf = NULL;
while (1) {
while (c != 255) {
u8 bit = 1 << (c & 0x7);
u8 cAlt = c ^ bit;
SCOPED_TRACE((unsigned int)c);
@@ -548,9 +544,7 @@ TEST_P(FDRFloodp, StreamingMask) {
}
}
if (++c == '\0') {
break;
}
++c;
}
matchesCounts.clear();
}

View File

@@ -48,9 +48,7 @@ std::ostream &operator<<(std::ostream &os, const flat_set<T> &f) {
os << "{";
for (auto it = begin(f); it != end(f); ++it) {
os << *it;
if (it != end(f)) {
os << ", ";
}
os << ", ";
}
os << "}";
return os;

View File

@@ -149,9 +149,7 @@ std::ostream &operator<<(std::ostream &os, const insertion_ordered_set<K> &s) {
os << "{";
for (auto it = begin(s); it != end(s); ++it) {
os << *it;
if (it != end(s)) {
os << ", ";
}
os << ", ";
}
os << "}";
return os;