mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-29 13:46:31 +00:00
AK: Remove now-unused UTF-16 length from UTF-8 string helper
This commit is contained in:
parent
04d32deb52
commit
6d1f90c739
Notes:
github-actions[bot]
2025-08-05 13:14:48 +00:00
Author: https://github.com/trflynn89
Commit: 6d1f90c739
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5720
Reviewed-by: https://github.com/gmta ✅
3 changed files with 0 additions and 15 deletions
|
@ -26,11 +26,6 @@ bool validate_utf16_be(ReadonlyBytes bytes)
|
|||
return simdutf::validate_utf16be(reinterpret_cast<char16_t const*>(bytes.data()), bytes.size() / 2);
|
||||
}
|
||||
|
||||
size_t utf16_code_unit_length_from_utf8(StringView string)
|
||||
{
|
||||
return simdutf::utf16_length_from_utf8(string.characters_without_null_termination(), string.length());
|
||||
}
|
||||
|
||||
ErrorOr<String> Utf16View::to_utf8(AllowLonelySurrogates allow_lonely_surrogates) const
|
||||
{
|
||||
if (is_empty())
|
||||
|
|
|
@ -28,8 +28,6 @@ namespace AK {
|
|||
[[nodiscard]] bool validate_utf16_le(ReadonlyBytes);
|
||||
[[nodiscard]] bool validate_utf16_be(ReadonlyBytes);
|
||||
|
||||
size_t utf16_code_unit_length_from_utf8(StringView);
|
||||
|
||||
namespace Detail {
|
||||
|
||||
static constexpr inline auto UTF16_FLAG = NumericLimits<size_t>::digits() - 1;
|
||||
|
|
|
@ -86,14 +86,6 @@ TEST_CASE(decode_utf16)
|
|||
EXPECT_EQ(i, expected.size());
|
||||
}
|
||||
|
||||
TEST_CASE(utf16_code_unit_length_from_utf8)
|
||||
{
|
||||
EXPECT_EQ(AK::utf16_code_unit_length_from_utf8(""sv), 0uz);
|
||||
EXPECT_EQ(AK::utf16_code_unit_length_from_utf8("abc"sv), 3uz);
|
||||
EXPECT_EQ(AK::utf16_code_unit_length_from_utf8("😀"sv), 2uz);
|
||||
EXPECT_EQ(AK::utf16_code_unit_length_from_utf8("Привет, мир! 😀 γειά σου κόσμος こんにちは世界"sv), 39uz);
|
||||
}
|
||||
|
||||
TEST_CASE(null_view)
|
||||
{
|
||||
Utf16View view;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue