diff options
Diffstat (limited to 'AK/AKString.h')
-rw-r--r-- | AK/AKString.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/AK/AKString.h b/AK/AKString.h index e75172a870..617bb6ab39 100644 --- a/AK/AKString.h +++ b/AK/AKString.h @@ -36,9 +36,12 @@ public: String() {} - String(StringView view) - : m_impl(StringImpl::create(view.characters(), view.length())) + String(const StringView& view) { + if (view.m_string) + *this = String(*view.m_string); + else + m_impl = StringImpl::create(view.characters(), view.length()); } String(const String& other) |