3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-06-27 08:28:44 +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

@ -152,7 +152,7 @@ std::string zstring::encode() const {
unsigned ch = m_buffer[i];
if (ch < 32 || ch >= 128 || ('\\' == ch && i + 1 < m_buffer.size() && 'u' == m_buffer[i+1])) {
_flush();
strm << "\\u{" << std::hex << ch << std::dec << "}";
strm << "\\u{" << std::hex << ch << std::dec << '}';
}
else {
if (offset == 99)
@ -161,7 +161,7 @@ std::string zstring::encode() const {
}
}
_flush();
return strm.str();
return std::move(strm).str();
}
bool zstring::suffixof(zstring const& other) const {