From f09216ac42bac9108e7f36ed2938c6f278f497e4 Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Sun, 6 Jun 2021 01:58:09 +0100 Subject: [PATCH] Revert "AK: Always inline FlyString::view()" This reverts commit 66f15c2e0c34caed8ce56075a366b20c4d1819af. --- AK/FlyString.cpp | 5 +++++ AK/FlyString.h | 3 ++- AK/StringImpl.h | 1 - 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/AK/FlyString.cpp b/AK/FlyString.cpp index 5ad1725d3a..d1b31e1449 100644 --- a/AK/FlyString.cpp +++ b/AK/FlyString.cpp @@ -115,6 +115,11 @@ FlyString FlyString::to_lowercase() const return String(*m_impl).to_lowercase(); } +StringView FlyString::view() const +{ + return { characters(), length() }; +} + bool FlyString::operator==(const String& other) const { if (m_impl == other.impl()) diff --git a/AK/FlyString.h b/AK/FlyString.h index 2613167849..778d448b3d 100644 --- a/AK/FlyString.h +++ b/AK/FlyString.h @@ -60,7 +60,8 @@ public: size_t length() const { return m_impl ? m_impl->length() : 0; } ALWAYS_INLINE u32 hash() const { return m_impl ? m_impl->existing_hash() : 0; } - ALWAYS_INLINE StringView view() const { return m_impl ? m_impl->view() : StringView {}; } + + StringView view() const; FlyString to_lowercase() const; diff --git a/AK/StringImpl.h b/AK/StringImpl.h index e84fa01432..316321ef5d 100644 --- a/AK/StringImpl.h +++ b/AK/StringImpl.h @@ -43,7 +43,6 @@ public: const char* characters() const { return &m_inline_buffer[0]; } ALWAYS_INLINE ReadonlyBytes bytes() const { return { characters(), length() }; } - ALWAYS_INLINE StringView view() const { return { characters(), length() }; } const char& operator[](size_t i) const {