mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-25 22:54:57 +02:00
JsonEncoder#GetResult(): std::move(), not copy, data
This commit is contained in:
parent
e510c037b2
commit
d01fc220fc
@ -68,7 +68,7 @@ public:
|
|||||||
String GetResult();
|
String GetResult();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::vector<char> m_Result;
|
std::string m_Result;
|
||||||
String m_CurrentKey;
|
String m_CurrentKey;
|
||||||
std::stack<std::bitset<2>> m_CurrentSubtree;
|
std::stack<std::bitset<2>> m_CurrentSubtree;
|
||||||
|
|
||||||
@ -450,14 +450,14 @@ template<bool prettyPrint>
|
|||||||
inline
|
inline
|
||||||
String JsonEncoder<prettyPrint>::GetResult()
|
String JsonEncoder<prettyPrint>::GetResult()
|
||||||
{
|
{
|
||||||
return String(m_Result.begin(), m_Result.end());
|
return std::move(m_Result);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<bool prettyPrint>
|
template<bool prettyPrint>
|
||||||
inline
|
inline
|
||||||
void JsonEncoder<prettyPrint>::AppendChar(char c)
|
void JsonEncoder<prettyPrint>::AppendChar(char c)
|
||||||
{
|
{
|
||||||
m_Result.emplace_back(c);
|
m_Result.push_back(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<bool prettyPrint>
|
template<bool prettyPrint>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user