mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-21 20:15:17 +00:00
AK: Use string_view() instead of to_string() in Formatter<wchar_t>
This let's us avoid a heap allocation.
This commit is contained in:
parent
ccad3d5a39
commit
e95470702e
Notes:
sideshowbarker
2024-07-17 18:40:13 +09:00
Author: https://github.com/IdanHo Commit: https://github.com/SerenityOS/serenity/commit/e95470702e Pull-request: https://github.com/SerenityOS/serenity/pull/12564 Reviewed-by: https://github.com/MaxWipfli
1 changed files with 1 additions and 2 deletions
|
@ -8,7 +8,6 @@
|
|||
#include <AK/Format.h>
|
||||
#include <AK/GenericLexer.h>
|
||||
#include <AK/IntegralMath.h>
|
||||
#include <AK/String.h>
|
||||
#include <AK/StringBuilder.h>
|
||||
#include <AK/kstdio.h>
|
||||
|
||||
|
@ -777,7 +776,7 @@ ErrorOr<void> Formatter<wchar_t>::format(FormatBuilder& builder, wchar_t value)
|
|||
codepoint.append_code_point(value);
|
||||
|
||||
Formatter<StringView> formatter { *this };
|
||||
return formatter.format(builder, codepoint.to_string());
|
||||
return formatter.format(builder, codepoint.string_view());
|
||||
}
|
||||
}
|
||||
ErrorOr<void> Formatter<bool>::format(FormatBuilder& builder, bool value)
|
||||
|
|
Loading…
Add table
Reference in a new issue