From b40e264448e55e48fcc62d92da13332d6d89459d Mon Sep 17 00:00:00 2001 From: Andres Noetzli Date: Fri, 19 Nov 2021 15:04:25 -0800 Subject: [PATCH] [API] Avoid copying values (#7666) --- src/api/cpp/cvc5.cpp | 2 +- src/api/cpp/cvc5.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/api/cpp/cvc5.cpp b/src/api/cpp/cvc5.cpp index d6980e45e..38cbdd7a6 100644 --- a/src/api/cpp/cvc5.cpp +++ b/src/api/cpp/cvc5.cpp @@ -5033,7 +5033,7 @@ void Solver::increment_vars_consts_stats(const Sort& sort, bool is_var) const /* .......................................................................... */ template -Term Solver::mkValHelper(T t) const +Term Solver::mkValHelper(const T& t) const { //////// all checks before this line Node res = getNodeManager()->mkConst(t); diff --git a/src/api/cpp/cvc5.h b/src/api/cpp/cvc5.h index ad6f4c7df..cd448123a 100644 --- a/src/api/cpp/cvc5.h +++ b/src/api/cpp/cvc5.h @@ -4504,7 +4504,7 @@ class CVC5_EXPORT Solver void checkMkTerm(Kind kind, uint32_t nchildren) const; /** Helper for mk-functions that call d_nodeMgr->mkConst(). */ template - Term mkValHelper(T t) const; + Term mkValHelper(const T& t) const; /** Helper for making rational values. */ Term mkRationalValHelper(const Rational& r) const; /** Helper for mkReal functions that take a string as argument. */ -- 2.30.2