From 4e80f22cc0b8d6ad09e29924f7ed42352d24292f Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sat, 30 May 2020 16:06:30 +0200 Subject: [PATCH] AK: Make some StringView constructors constexpr --- AK/StringView.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/AK/StringView.h b/AK/StringView.h index f6a06afcc5..2df811db58 100644 --- a/AK/StringView.h +++ b/AK/StringView.h @@ -38,8 +38,8 @@ class StringView { public: using ConstIterator = const char*; - ALWAYS_INLINE StringView() { } - ALWAYS_INLINE StringView(const char* characters, size_t length) + ALWAYS_INLINE constexpr StringView() { } + ALWAYS_INLINE constexpr StringView(const char* characters, size_t length) : m_characters(characters) , m_length(length) { @@ -51,7 +51,7 @@ public: { ASSERT(!Checked::addition_would_overflow((uintptr_t)characters, length)); } - ALWAYS_INLINE StringView(const char* cstring) + ALWAYS_INLINE constexpr StringView(const char* cstring) : m_characters(cstring) , m_length(cstring ? __builtin_strlen(cstring) : 0) {