3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-06-14 01:46:15 +00:00

remove a few string copies

This commit is contained in:
Nuno Lopes 2023-12-20 16:55:09 +00:00
parent db5a1a7604
commit b2d5c24c1d
18 changed files with 39 additions and 80 deletions

View file

@ -185,7 +185,7 @@ extern "C" {
std::ostringstream buffer;
to_goal_ref(g)->display(buffer);
// Hack for removing the trailing '\n'
std::string result = buffer.str();
std::string result = std::move(buffer).str();
SASSERT(result.size() > 0);
result.resize(result.size()-1);
return mk_c(c)->mk_external_string(std::move(result));
@ -203,7 +203,7 @@ extern "C" {
}
to_goal_ref(g)->display_dimacs(buffer, include_names);
// Hack for removing the trailing '\n'
std::string result = buffer.str();
std::string result = std::move(buffer).str();
SASSERT(result.size() > 0);
result.resize(result.size()-1);
return mk_c(c)->mk_external_string(std::move(result));