diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/theory/strings/theory_strings_rewriter.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/theory/strings/theory_strings_rewriter.cpp b/src/theory/strings/theory_strings_rewriter.cpp index a426c0306..78def9c0a 100644 --- a/src/theory/strings/theory_strings_rewriter.cpp +++ b/src/theory/strings/theory_strings_rewriter.cpp @@ -2915,9 +2915,10 @@ bool TheoryStringsRewriter::stripConstantEndpoints(std::vector<Node>& n1, { const std::vector<unsigned>& svec = s.getVec(); // can remove up to the first occurrence of a digit - for (unsigned i = 0; i < svec.size(); i++) + unsigned svsize = svec.size(); + for (unsigned i = 0; i < svsize; i++) { - unsigned sindex = r == 0 ? i : svec.size() - i; + unsigned sindex = r == 0 ? i : (svsize - 1) - i; if (String::isDigit(svec[sindex])) { break; |