From d01fc220fc19607cad0707bf238ef5140208fd07 Mon Sep 17 00:00:00 2001 From: "Alexander A. Klimov" Date: Wed, 2 Apr 2025 15:09:31 +0200 Subject: [PATCH] JsonEncoder#GetResult(): std::move(), not copy, data --- lib/base/json.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/base/json.cpp b/lib/base/json.cpp index 56893308a..b721f005b 100644 --- a/lib/base/json.cpp +++ b/lib/base/json.cpp @@ -68,7 +68,7 @@ public: String GetResult(); private: - std::vector m_Result; + std::string m_Result; String m_CurrentKey; std::stack> m_CurrentSubtree; @@ -450,14 +450,14 @@ template inline String JsonEncoder::GetResult() { - return String(m_Result.begin(), m_Result.end()); + return std::move(m_Result); } template inline void JsonEncoder::AppendChar(char c) { - m_Result.emplace_back(c); + m_Result.push_back(c); } template