mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 12:19:54 +00:00
AK+LibUnicode: Implement String::equals_ignoring_case without allocating
We currently fully casefold the left- and right-hand sides to compare two strings with case-insensitivity. Now, we casefold one code point at a time, storing the result in a view for comparison, until we exhaust both strings.
This commit is contained in:
parent
4aee4e80bd
commit
1393ed2000
Notes:
sideshowbarker
2024-07-17 07:16:27 +09:00
Author: https://github.com/trflynn89
Commit: 1393ed2000
Pull-request: https://github.com/SerenityOS/serenity/pull/17769
Reviewed-by: https://github.com/Hendiadyoin1
Reviewed-by: https://github.com/linusg ✅
6 changed files with 150 additions and 52 deletions
|
@ -9,6 +9,7 @@
|
|||
#include <AK/Error.h>
|
||||
#include <AK/Forward.h>
|
||||
#include <AK/Optional.h>
|
||||
#include <AK/Utf32View.h>
|
||||
#include <AK/Utf8View.h>
|
||||
#include <LibUnicode/Forward.h>
|
||||
|
||||
|
@ -18,5 +19,6 @@ ErrorOr<void> build_lowercase_string(Utf8View code_points, StringBuilder& builde
|
|||
ErrorOr<void> build_uppercase_string(Utf8View code_points, StringBuilder& builder, Optional<StringView> const& locale);
|
||||
ErrorOr<void> build_titlecase_string(Utf8View code_points, StringBuilder& builder, Optional<StringView> const& locale);
|
||||
ErrorOr<void> build_casefold_string(Utf8View code_points, StringBuilder& builder);
|
||||
Utf32View casefold_code_point(u32 const& code_point);
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue