From 5ebd588e5fccb27bc0641336bf2e01a93e06a936 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Sun, 20 Apr 2014 12:19:14 +0100 Subject: [PATCH] remove unused memoryview String::data --- src/string.hh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/string.hh b/src/string.hh index 94429e28..fd10c23f 100644 --- a/src/string.hh +++ b/src/string.hh @@ -47,8 +47,6 @@ public: String operator+(Codepoint cp) const { String res = *this; utf8::dump(back_inserter(res), cp); return res; } String& operator+=(Codepoint cp) { utf8::dump(back_inserter(*this), cp); return *this; } - memoryview data() const { return memoryview(std::string::data(), size()); } - String substr(ByteCount pos, ByteCount length = -1) const { return String{std::string::substr((int)pos, (int)length)}; @@ -69,7 +67,7 @@ public: : m_data{data}, m_length{length} {} constexpr StringView(const char* data) : m_data{data}, m_length{(int)strlen(data)} {} constexpr StringView(const char* begin, const char* end) : m_data{begin}, m_length{(int)(end - begin)} {} - StringView(const String& str) : m_data{str.data().pointer()}, m_length{str.length()} {} + StringView(const String& str) : m_data{str.data()}, m_length{str.length()} {} bool operator==(StringView other) const; bool operator!=(StringView other) const;