AK: Always inline trivial StringView constructors

This commit is contained in:
Sergey Bugaev 2020-04-30 11:51:55 +03:00 committed by Andreas Kling
parent 135d29b498
commit 279cf9294a
Notes: sideshowbarker 2024-07-19 07:09:39 +09:00

View file

@ -38,14 +38,14 @@ class StringView {
public:
using ConstIterator = const char*;
StringView() { }
StringView(const char* characters, size_t length)
[[gnu::always_inline]] inline StringView() { }
[[gnu::always_inline]] inline StringView(const char* characters, size_t length)
: m_characters(characters)
, m_length(length)
{
ASSERT(!Checked<uintptr_t>::addition_would_overflow((uintptr_t)characters, length));
}
StringView(const unsigned char* characters, size_t length)
[[gnu::always_inline]] inline StringView(const unsigned char* characters, size_t length)
: m_characters((const char*)characters)
, m_length(length)
{