mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-15 23:09:05 +00:00
AK: Remove constexpr specifier from Utf16View::bytes()
The Span constructor used here uses reinterpret_cast under the hood, so it and Utf16View::bytes() cannot be constexpr.
This commit is contained in:
parent
9bf250c8d1
commit
6ddbb70051
Notes:
github-actions[bot]
2025-07-22 17:34:57 +00:00
Author: https://github.com/trflynn89
Commit: 6ddbb70051
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5566
1 changed files with 2 additions and 2 deletions
|
@ -169,7 +169,7 @@ public:
|
|||
|
||||
[[nodiscard]] constexpr bool has_ascii_storage() const { return m_length_in_code_units >> Detail::UTF16_FLAG == 0; }
|
||||
|
||||
[[nodiscard]] constexpr ReadonlyBytes bytes() const
|
||||
[[nodiscard]] ALWAYS_INLINE ReadonlyBytes bytes() const
|
||||
{
|
||||
VERIFY(has_ascii_storage());
|
||||
return { m_string.ascii, length_in_code_units() };
|
||||
|
@ -216,7 +216,7 @@ public:
|
|||
[[nodiscard]] constexpr bool operator==(StringView other) const
|
||||
{
|
||||
if (has_ascii_storage())
|
||||
return bytes() == other.bytes();
|
||||
return StringView { m_string.ascii, length_in_code_units() } == other;
|
||||
return *this == Utf16View { other.characters_without_null_termination(), other.length() };
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue