summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrew Reynolds <andrew.j.reynolds@gmail.com>2018-06-12 15:22:15 -0500
committerAndres Noetzli <andres.noetzli@gmail.com>2018-06-12 13:22:15 -0700
commitb0a4253162ae4735f15540b41794f05f4f7f26f8 (patch)
treeee5b06f4a3ae2efa8dbbddb7e77237a65292dd18 /src
parentb19c840d2bd756d272b8b44c122be809a8b1c633 (diff)
Fix strip constant endpoint for ITOS in strings rewriter (#2067)
Diffstat (limited to 'src')
-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