forked from qt-creator/qt-creator
Utils: Clone the capacity too
It has it's advantages if the text grows otherwise we maybe waste memory. Change-Id: Ic76d25207c2ef18182069fbf64bc0fb955a85353 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
@@ -207,7 +207,9 @@ public:
|
|||||||
BasicSmallString clonedString(m_data);
|
BasicSmallString clonedString(m_data);
|
||||||
|
|
||||||
if (Q_UNLIKELY(hasAllocatedMemory()))
|
if (Q_UNLIKELY(hasAllocatedMemory()))
|
||||||
new (&clonedString) BasicSmallString{m_data.allocated.data.pointer, m_data.allocated.data.size};
|
new (&clonedString) BasicSmallString{m_data.allocated.data.pointer,
|
||||||
|
m_data.allocated.data.size,
|
||||||
|
m_data.allocated.data.capacity};
|
||||||
|
|
||||||
return clonedString;
|
return clonedString;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user