From: Konstantinos Margaritis Date: Sat, 11 May 2024 21:05:45 +0000 (+0300) Subject: Fix false positive /identicalConditionAfterEarlyExit warnings X-Git-Tag: vectorscan/5.4.12^2~49^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F271%2Fhead;p=thirdparty%2Fvectorscan.git Fix false positive /identicalConditionAfterEarlyExit warnings --- diff --git a/src/parser/ComponentBoundary.cpp b/src/parser/ComponentBoundary.cpp index e8eafc8c..f116cc1b 100644 --- a/src/parser/ComponentBoundary.cpp +++ b/src/parser/ComponentBoundary.cpp @@ -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