mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-11 18:20:43 +09:00
LibUnicode: Avoid redundant UTF-8 validation in AK::String helpers
This commit is contained in:
parent
1068518bdf
commit
df547bb321
Notes:
sideshowbarker
2024-07-17 05:41:34 +09:00
Author: https://github.com/awesomekling
Commit: df547bb321
Pull-request: https://github.com/SerenityOS/serenity/pull/24058
Reviewed-by: https://github.com/trflynn89 ✅
1 changed files with 4 additions and 4 deletions
|
@ -18,28 +18,28 @@ ErrorOr<String> String::to_lowercase(Optional<StringView> const& locale) const
|
|||
{
|
||||
StringBuilder builder;
|
||||
TRY(Unicode::Detail::build_lowercase_string(code_points(), builder, locale));
|
||||
return builder.to_string();
|
||||
return builder.to_string_without_validation();
|
||||
}
|
||||
|
||||
ErrorOr<String> String::to_uppercase(Optional<StringView> const& locale) const
|
||||
{
|
||||
StringBuilder builder;
|
||||
TRY(Unicode::Detail::build_uppercase_string(code_points(), builder, locale));
|
||||
return builder.to_string();
|
||||
return builder.to_string_without_validation();
|
||||
}
|
||||
|
||||
ErrorOr<String> String::to_titlecase(Optional<StringView> const& locale, TrailingCodePointTransformation trailing_code_point_transformation) const
|
||||
{
|
||||
StringBuilder builder;
|
||||
TRY(Unicode::Detail::build_titlecase_string(code_points(), builder, locale, trailing_code_point_transformation));
|
||||
return builder.to_string();
|
||||
return builder.to_string_without_validation();
|
||||
}
|
||||
|
||||
ErrorOr<String> String::to_casefold() const
|
||||
{
|
||||
StringBuilder builder;
|
||||
TRY(Unicode::Detail::build_casefold_string(code_points(), builder));
|
||||
return builder.to_string();
|
||||
return builder.to_string_without_validation();
|
||||
}
|
||||
|
||||
bool String::equals_ignoring_case(String const& other) const
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue