mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-21 23:20:20 +00:00
AK: Simplify and optimize ASCIICaseInsensitiveFlyStringTraits::equals
The member function `equals_ignoring_ascii_case` has a fast path which will return early if it is the same FlyString instance.
This commit is contained in:
parent
f186e7e537
commit
8c34842962
Notes:
sideshowbarker
2024-07-17 01:46:00 +09:00
Author: https://github.com/shannonbooth Commit: https://github.com/SerenityOS/serenity/commit/8c34842962 Pull-request: https://github.com/SerenityOS/serenity/pull/23865
1 changed files with 1 additions and 1 deletions
|
@ -97,7 +97,7 @@ struct Formatter<FlyString> : Formatter<StringView> {
|
|||
|
||||
struct ASCIICaseInsensitiveFlyStringTraits : public Traits<String> {
|
||||
static unsigned hash(FlyString const& s) { return s.ascii_case_insensitive_hash(); }
|
||||
static bool equals(FlyString const& a, FlyString const& b) { return a.bytes().data() == b.bytes().data() || a.bytes_as_string_view().equals_ignoring_ascii_case(b.bytes_as_string_view()); }
|
||||
static bool equals(FlyString const& a, FlyString const& b) { return a.equals_ignoring_ascii_case(b); }
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue