mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-08 05:27:14 +09:00
AK: Tweak ShortString bit layout slightly
Move the byte count one step to the left in order to make space for the JS::StringOrSymbol flag.
This commit is contained in:
parent
53da8893ac
commit
1662223e89
Notes:
github-actions[bot]
2025-03-24 22:28:38 +00:00
Author: https://github.com/awesomekling
Commit: 1662223e89
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4067
Reviewed-by: https://github.com/trflynn89
2 changed files with 5 additions and 3 deletions
|
@ -18,7 +18,7 @@ ReadonlyBytes ShortString::bytes() const
|
|||
|
||||
size_t ShortString::byte_count() const
|
||||
{
|
||||
return byte_count_and_short_string_flag >> 1;
|
||||
return byte_count_and_short_string_flag >> StringBase::SHORT_STRING_BYTE_COUNT_SHIFT_COUNT;
|
||||
}
|
||||
|
||||
StringBase::StringBase(NonnullRefPtr<Detail::StringData const> data)
|
||||
|
@ -78,7 +78,7 @@ size_t StringBase::byte_count() const
|
|||
{
|
||||
ASSERT(!is_invalid());
|
||||
if (is_short_string())
|
||||
return m_short_string.byte_count_and_short_string_flag >> 1;
|
||||
return m_short_string.byte_count_and_short_string_flag >> StringBase::SHORT_STRING_BYTE_COUNT_SHIFT_COUNT;
|
||||
return m_data->byte_count();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue