From ebce4ead401de12dcb4c11d8818721d82b03afbe Mon Sep 17 00:00:00 2001 From: asynts Date: Wed, 19 Aug 2020 11:43:41 +0200 Subject: [PATCH] AK: Add StringView(ReadonlyBytes) constructor. --- AK/StringView.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/AK/StringView.h b/AK/StringView.h index 4e8a652dec..a1d4de9cbb 100644 --- a/AK/StringView.h +++ b/AK/StringView.h @@ -57,6 +57,11 @@ public: , m_length(cstring ? __builtin_strlen(cstring) : 0) { } + ALWAYS_INLINE StringView(ReadonlyBytes bytes) + : m_characters(reinterpret_cast(bytes.data())) + , m_length(bytes.size()) + { + } StringView(const ByteBuffer&); StringView(const String&);