mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-06 19:19:44 +03:00
AK: Reduce code duplication in StringBuilder
This commit is contained in:
parent
d8df9c510c
commit
6da131d5db
Notes:
sideshowbarker
2024-07-19 17:37:08 +09:00
Author: https://github.com/f-eiwu Commit: https://github.com/SerenityOS/serenity/commit/6da131d5db0 Pull-request: https://github.com/SerenityOS/serenity/pull/1386 Reviewed-by: https://github.com/awesomekling
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user