mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
AK: Add a DeprecatedString::byte_at() getter
`operator[]` returns a char, this is used in Jakt.
This commit is contained in:
parent
c547b55a00
commit
7a17fd6d71
Notes:
sideshowbarker
2024-07-17 03:26:48 +09:00
Author: https://github.com/alimpfard Commit: https://github.com/SerenityOS/serenity/commit/7a17fd6d71 Pull-request: https://github.com/SerenityOS/serenity/pull/16396 Reviewed-by: https://github.com/ADKaster Reviewed-by: https://github.com/awesomekling ✅
1 changed files with 6 additions and 0 deletions
|
@ -192,6 +192,12 @@ public:
|
|||
return (*m_impl)[i];
|
||||
}
|
||||
|
||||
[[nodiscard]] ALWAYS_INLINE u8 byte_at(size_t i) const
|
||||
{
|
||||
VERIFY(!is_null());
|
||||
return bit_cast<u8>((*m_impl)[i]);
|
||||
}
|
||||
|
||||
using ConstIterator = SimpleIterator<const DeprecatedString, char const>;
|
||||
|
||||
[[nodiscard]] constexpr ConstIterator begin() const { return ConstIterator::begin(*this); }
|
||||
|
|
Loading…
Reference in a new issue