From 4e25e5066bfd6a1ea9d5dbfa5db9e25b66b8aa02 Mon Sep 17 00:00:00 2001 From: Hein-Pieter van Braam Date: Sun, 16 Dec 2018 00:44:18 +0000 Subject: Reduce String CoW By introducing an intermediate proxy class for the array subscript operator for String and CharString we can control better when CowData will actually CoW. This should improve performance of String usage for most cases. --- modules/mono/mono_gd/gd_mono_marshal.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/mono') diff --git a/modules/mono/mono_gd/gd_mono_marshal.cpp b/modules/mono/mono_gd/gd_mono_marshal.cpp index 3f0a5d6e50..b0b2aec667 100644 --- a/modules/mono/mono_gd/gd_mono_marshal.cpp +++ b/modules/mono/mono_gd/gd_mono_marshal.cpp @@ -216,7 +216,7 @@ String mono_to_utf16_string(MonoString *p_mono_string) { ret.set(len, 0); CharType *src = (CharType *)mono_string_chars(p_mono_string); - CharType *dst = &(ret.operator[](0)); + CharType *dst = ret.ptrw(); for (int i = 0; i < len; i++) { dst[i] = src[i]; -- cgit v1.2.3