Fix compiler warnings. (#5644)
authorAina Niemetz <aina.niemetz@gmail.com>
Wed, 9 Dec 2020 22:13:05 +0000 (14:13 -0800)
committerGitHub <noreply@github.com>
Wed, 9 Dec 2020 22:13:05 +0000 (14:13 -0800)
src/theory/strings/sequences_rewriter.cpp

index 1382ab0f92e529604f84eccfcf4cf2d12333e0cc..2a30727ba9e29434370c975b75132740789eda49 100644 (file)
@@ -1517,7 +1517,6 @@ RewriteResponse SequencesRewriter::preRewrite(TNode node)
 Node SequencesRewriter::rewriteSeqNth(Node node)
 {
   Assert(node.getKind() == SEQ_NTH || node.getKind() == SEQ_NTH_TOTAL);
-  Node ret;
   Node s = node[0];
   Node i = node[1];
   if (s.isConst() && i.isConst())
@@ -1527,7 +1526,7 @@ Node SequencesRewriter::rewriteSeqNth(Node node)
     if (pos < len)
     {
       std::vector<Node> elements = s.getConst<Sequence>().getVec();
-      ret = elements[pos];
+      const Node& ret = elements[pos];
       return returnRewrite(node, ret, Rewrite::SEQ_NTH_EVAL);
     }
     else if (node.getKind() == SEQ_NTH_TOTAL)