mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-02 04:20:28 +00:00
AK: Always inline trivial StringView constructors
This commit is contained in:
parent
135d29b498
commit
279cf9294a
Notes:
sideshowbarker
2024-07-19 07:09:39 +09:00
Author: https://github.com/bugaevc Commit: https://github.com/SerenityOS/serenity/commit/279cf9294ac Pull-request: https://github.com/SerenityOS/serenity/pull/2024 Reviewed-by: https://github.com/awesomekling
1 changed files with 3 additions and 3 deletions
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue