mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 06:47:34 +00:00
AK: Store data in FlyString as StringBase
Unfortunately, it is not clear to me how to split this commit into several atomic ones.
This commit is contained in:
parent
e7700e16ee
commit
fa52f68142
7 changed files with 42 additions and 145 deletions
|
@ -68,15 +68,12 @@ public:
|
|||
|
||||
[[nodiscard]] bool operator==(StringBase const&) const;
|
||||
|
||||
void did_create_fly_string(Badge<FlyString>) const;
|
||||
|
||||
protected:
|
||||
// NOTE: If the least significant bit of the pointer is set, this is a short string.
|
||||
static constexpr uintptr_t SHORT_STRING_FLAG = 1;
|
||||
|
||||
static constexpr bool has_short_string_bit(uintptr_t data)
|
||||
{
|
||||
return (data & SHORT_STRING_FLAG) != 0;
|
||||
}
|
||||
|
||||
explicit StringBase(NonnullRefPtr<Detail::StringData const>);
|
||||
|
||||
explicit constexpr StringBase(ShortString short_string)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue