Merge pull request #271 from VectorCamp/bugfix/cppcheck-identicalConditionAfterEarlyExit

Fix marked as false positive identicalConditionAfterEarlyExit cppcheck warnings
This commit is contained in:
Konstantinos Margaritis 2024-05-13 10:25:34 +03:00 committed by GitHub
commit 77cdcec359
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -161,26 +161,26 @@ void ComponentBoundary::buildFollowSet(GlushkovBuildState &,
bool ComponentBoundary::checkEmbeddedStartAnchor(bool at_start) const {
if (at_start) {
return at_start;
return true;
}
if (m_bound == BEGIN_STRING || m_bound == BEGIN_LINE) {
throw ParseError("Embedded start anchors not supported.");
}
return at_start;
return false;
}
bool ComponentBoundary::checkEmbeddedEndAnchor(bool at_end) const {
if (at_end) {
return at_end;
return true;
}
if (m_bound != BEGIN_STRING && m_bound != BEGIN_LINE) {
throw ParseError("Embedded end anchors not supported.");
}
return at_end;
return false;
}
} // namespace