summaryrefslogtreecommitdiff
path: root/AK/StringView.h
diff options
context:
space:
mode:
authorRobin Burchell <robin+git@viroteck.net>2019-06-03 18:27:56 +0200
committerAndreas Kling <awesomekling@gmail.com>2019-06-03 20:27:05 +0200
commitf9ba7adae2efaa2e2bdc47a13ff22aed401261b3 (patch)
tree87e22463fdd5c5e14d2f4cf9ca7e2ada15815a56 /AK/StringView.h
parent8fecc0eaeeacf0b623f495258c32a785c67b0c32 (diff)
downloadserenity-f9ba7adae2efaa2e2bdc47a13ff22aed401261b3.zip
StringView: Make construction of String from a StringView containing a String cheaper
... at the cost of an additional pointer per view.
Diffstat (limited to 'AK/StringView.h')
-rw-r--r--AK/StringView.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/AK/StringView.h b/AK/StringView.h
index 4ef404c8e0..8e5b31127d 100644
--- a/AK/StringView.h
+++ b/AK/StringView.h
@@ -44,6 +44,8 @@ public:
bool operator==(const String&) const;
private:
+ friend class String;
+ const AK::String* m_string { nullptr };
const char* m_characters { nullptr };
int m_length { 0 };
};