mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 21:47:45 +00:00
LibTextCodec+Everywhere: Make TextCodec::decoder_for() take a StringView
We don't need a full String/DeprecatedString inside this function, so we might as well not force users to create one.
This commit is contained in:
parent
3c8bfa4662
commit
d6075ef5b5
14 changed files with 16 additions and 16 deletions
|
@ -321,7 +321,7 @@ DeprecatedString Name::string_for_id(NameId id) const
|
|||
auto const offset = name_record.string_offset;
|
||||
|
||||
if (platform_id == to_underlying(Platform::Windows)) {
|
||||
static auto& decoder = *TextCodec::decoder_for("utf-16be");
|
||||
static auto& decoder = *TextCodec::decoder_for("utf-16be"sv);
|
||||
return decoder.to_utf8(StringView { (char const*)m_slice.offset_pointer(storage_offset + offset), length });
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue