AK: Make FlyString::hash() use the cached hash in StringData if possible

This avoids rehashing the string every time.
This commit is contained in:
Andreas Kling 2023-03-08 23:11:59 +01:00
commit d517e7fb3a
Notes: sideshowbarker 2024-07-17 06:40:21 +09:00
3 changed files with 15 additions and 2 deletions

View file

@ -213,6 +213,7 @@ public:
[[nodiscard]] static String fly_string_data_to_string(Badge<FlyString>, uintptr_t const&);
[[nodiscard]] static StringView fly_string_data_to_string_view(Badge<FlyString>, uintptr_t const&);
[[nodiscard]] static u32 fly_string_data_to_hash(Badge<FlyString>, uintptr_t const&);
[[nodiscard]] uintptr_t to_fly_string_data(Badge<FlyString>) const;
static void ref_fly_string_data(Badge<FlyString>, uintptr_t);