mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-21 23:20:20 +00:00
AK: Add StringView(ReadonlyBytes) constructor.
This commit is contained in:
parent
b1fc8d2b38
commit
ebce4ead40
Notes:
sideshowbarker
2024-07-19 03:24:27 +09:00
Author: https://github.com/asynts Commit: https://github.com/SerenityOS/serenity/commit/ebce4ead401 Pull-request: https://github.com/SerenityOS/serenity/pull/3220 Reviewed-by: https://github.com/awesomekling
1 changed files with 5 additions and 0 deletions
|
@ -57,6 +57,11 @@ public:
|
|||
, m_length(cstring ? __builtin_strlen(cstring) : 0)
|
||||
{
|
||||
}
|
||||
ALWAYS_INLINE StringView(ReadonlyBytes bytes)
|
||||
: m_characters(reinterpret_cast<const char*>(bytes.data()))
|
||||
, m_length(bytes.size())
|
||||
{
|
||||
}
|
||||
|
||||
StringView(const ByteBuffer&);
|
||||
StringView(const String&);
|
||||
|
|
Loading…
Reference in a new issue