summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorajreynol <andrew.j.reynolds@gmail.com>2018-06-12 13:20:30 -0500
committerajreynol <andrew.j.reynolds@gmail.com>2018-06-12 13:20:30 -0500
commit64ae92734bbddb70fa5fbce17b9bbc6ca5580ebd (patch)
treee7efcfffa2106004e18d7b30dae0aee166529155
parent6375e50f69df7a097842cc78a3139fde2cfd8d10 (diff)
Fix strings rewriter.
-rw-r--r--src/theory/strings/theory_strings_rewriter.cpp5
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;
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback