From cc3c2138a656fc79b781afc3dbc8286201fd804d Mon Sep 17 00:00:00 2001 From: chriseth Date: Mon, 27 Jun 2022 15:48:15 +0200 Subject: [PATCH] Avoid copying sorts. --- tools/solsmt.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tools/solsmt.cpp b/tools/solsmt.cpp index 1132d9165..d883b8ca1 100644 --- a/tools/solsmt.cpp +++ b/tools/solsmt.cpp @@ -140,7 +140,7 @@ bool isNumber(string_view const& _expr) } } -smtutil::Expression toSMTUtilExpression(SMTLib2Expression const& _expr, map const& _variableSorts) +smtutil::Expression toSMTUtilExpression(SMTLib2Expression const& _expr, map& _variableSorts) { return std::visit(GenericVisitor{ [&](string_view const& _atom) { @@ -157,8 +157,7 @@ smtutil::Expression toSMTUtilExpression(SMTLib2Expression const& _expr, map(_subExpr.front().data); if (op == "let") { - // TODO would be good if we did not have to copy this here. - map subSorts = _variableSorts; + map subSorts; solAssert(_subExpr.size() == 3); // We change the nesting here: // (let ((x1 t1) (x2 t2)) T) -> let(x1(t1), x2(t2), T) @@ -174,7 +173,11 @@ smtutil::Expression toSMTUtilExpression(SMTLib2Expression const& _expr, map