mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 05:57:45 +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
6 changed files with 150 additions and 52 deletions
|
@ -109,7 +109,7 @@ public:
|
|||
ErrorOr<String> to_casefold() const;
|
||||
|
||||
// Compare this String against another string with caseless matching. Using this method requires linking LibUnicode into your application.
|
||||
ErrorOr<bool> equals_ignoring_case(String const&) const;
|
||||
[[nodiscard]] bool equals_ignoring_case(String const&) const;
|
||||
|
||||
[[nodiscard]] bool starts_with(u32 code_point) const;
|
||||
[[nodiscard]] bool starts_with_bytes(StringView) const;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue