mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 11:07:45 +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
1 changed files with 1 additions and 2 deletions
|
@ -8,7 +8,6 @@
|
||||||
#include <AK/Format.h>
|
#include <AK/Format.h>
|
||||||
#include <AK/GenericLexer.h>
|
#include <AK/GenericLexer.h>
|
||||||
#include <AK/IntegralMath.h>
|
#include <AK/IntegralMath.h>
|
||||||
#include <AK/String.h>
|
|
||||||
#include <AK/StringBuilder.h>
|
#include <AK/StringBuilder.h>
|
||||||
#include <AK/kstdio.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);
|
codepoint.append_code_point(value);
|
||||||
|
|
||||||
Formatter<StringView> formatter { *this };
|
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)
|
ErrorOr<void> Formatter<bool>::format(FormatBuilder& builder, bool value)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue