mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-21 23:20:20 +00:00
AK: Add FlyString::operator<=>(FlyString const&)
Same as String already has.
This commit is contained in:
parent
1e820385d9
commit
e4d14e1afc
Notes:
sideshowbarker
2024-07-18 04:46:35 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/e4d14e1afc Pull-request: https://github.com/SerenityOS/serenity/pull/20969 Reviewed-by: https://github.com/shannonbooth Reviewed-by: https://github.com/trflynn89
2 changed files with 7 additions and 0 deletions
|
@ -183,6 +183,11 @@ unsigned Traits<FlyString>::hash(FlyString const& fly_string)
|
|||
return fly_string.hash();
|
||||
}
|
||||
|
||||
int FlyString::operator<=>(FlyString const& other) const
|
||||
{
|
||||
return bytes_as_string_view().compare(other.bytes_as_string_view());
|
||||
}
|
||||
|
||||
ErrorOr<void> Formatter<FlyString>::format(FormatBuilder& builder, FlyString const& fly_string)
|
||||
{
|
||||
return Formatter<StringView>::format(builder, fly_string.bytes_as_string_view());
|
||||
|
|
|
@ -50,6 +50,8 @@ public:
|
|||
[[nodiscard]] bool operator==(StringView) const;
|
||||
[[nodiscard]] bool operator==(char const*) const;
|
||||
|
||||
[[nodiscard]] int operator<=>(FlyString const& other) const;
|
||||
|
||||
static void did_destroy_fly_string_data(Badge<Detail::StringData>, StringView);
|
||||
[[nodiscard]] uintptr_t data(Badge<String>) const;
|
||||
|
||||
|
|
Loading…
Reference in a new issue