summaryrefslogtreecommitdiff
path: root/AK/AKString.h
diff options
context:
space:
mode:
Diffstat (limited to 'AK/AKString.h')
-rw-r--r--AK/AKString.h7
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)