mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 05:17:35 +00:00
StringBuilder: Use a ByteBuffer internally instead of a Vector<String>.
This commit is contained in:
parent
074edffc44
commit
9d7da26b4e
6 changed files with 58 additions and 37 deletions
|
@ -73,6 +73,14 @@ public:
|
|||
return copy(offset_pointer(offset), size);
|
||||
}
|
||||
|
||||
void grow(size_t size)
|
||||
{
|
||||
if (!m_impl)
|
||||
m_impl = Buffer<byte>::create_uninitialized(size);
|
||||
else
|
||||
m_impl->grow(size);
|
||||
}
|
||||
|
||||
private:
|
||||
explicit ByteBuffer(RetainPtr<Buffer<byte>>&& impl)
|
||||
: m_impl(move(impl))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue