AK: Reduce code duplication in StringBuilder

This commit is contained in:
howar6hill 2020-03-08 22:59:14 +08:00 committed by Andreas Kling
parent d8df9c510c
commit 6da131d5db
Notes: sideshowbarker 2024-07-19 17:37:08 +09:00

View File

@ -54,11 +54,7 @@ void StringBuilder::append(const StringView& str)
void StringBuilder::append(const char* characters, size_t length)
{
if (!length)
return;
will_append(length);
memcpy(m_buffer.data() + m_length, characters, length);
m_length += length;
append(StringView { characters, length });
}
void StringBuilder::append(char ch)