mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-21 23:20:20 +00:00
AK: Make some StringView constructors constexpr
This commit is contained in:
parent
d92c9d3772
commit
4e80f22cc0
Notes:
sideshowbarker
2024-07-19 05:56:46 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/4e80f22cc0b
1 changed files with 3 additions and 3 deletions
|
@ -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<uintptr_t>::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)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue