mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 11:49:44 +00:00
AK: Avoid a copy in StringBuilder's default constructor
This commit is contained in:
parent
7faeef8d0d
commit
b844f3219e
Notes:
github-actions[bot]
2025-06-16 07:45:34 +00:00
Author: https://github.com/LucasChollet
Commit: b844f3219e
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5098
Reviewed-by: https://github.com/gmta ✅
1 changed files with 2 additions and 1 deletions
|
@ -41,8 +41,9 @@ ErrorOr<StringBuilder> StringBuilder::create(size_t initial_capacity)
|
|||
}
|
||||
|
||||
StringBuilder::StringBuilder()
|
||||
: StringBuilder(inline_capacity)
|
||||
{
|
||||
static_assert(inline_capacity > STRING_BASE_PREFIX_SIZE);
|
||||
m_buffer.resize(STRING_BASE_PREFIX_SIZE);
|
||||
}
|
||||
|
||||
StringBuilder::StringBuilder(size_t initial_capacity)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue