From 3ab4127ae3fc3b837f5350509c78db03467500cd Mon Sep 17 00:00:00 2001 From: dec05eba Date: Mon, 23 Apr 2018 13:30:03 +0200 Subject: Add support for big emoji if it's the only thing on a line TODO: Currently message board renders directly to window, it should render to render target for optimization purpose --- include/StringView.hpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'include/StringView.hpp') diff --git a/include/StringView.hpp b/include/StringView.hpp index 4e9066b..9eea387 100644 --- a/include/StringView.hpp +++ b/include/StringView.hpp @@ -15,7 +15,7 @@ namespace dchat } - BasicStringView(const BasicStringView &other) : data(other.data), size(other.size) + BasicStringView(const BasicStringView &other) : data(other.data), size(other.size) { } @@ -30,13 +30,14 @@ namespace dchat } - BasicStringView operator = (const BasicStringView &other) + BasicStringView& operator = (const BasicStringView &other) { - BasicStringView result(other.data, other.size); - return result; + data = other.data; + size = other.size; + return *this; } - BasicStringView( BasicStringView &&other) + BasicStringView(BasicStringView &&other) { data = other.data; size = other.size; @@ -45,10 +46,10 @@ namespace dchat other.size = 0; } - bool equals(const BasicStringView &other) const + bool equals(const BasicStringView &other) const { if(size != other.size) return false; - return memcmp(data, other.data, size) == 0; + return memcmp(data, other.data, size * sizeof(CharType)) == 0; } CharType operator [] (usize index) const -- cgit v1.2.3