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/gdnative/include/gdnative/string.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/gdnative/include') diff --git a/modules/gdnative/include/gdnative/string.h b/modules/gdnative/include/gdnative/string.h index 95ae42a9ec..2ca9fd9e15 100644 --- a/modules/gdnative/include/gdnative/string.h +++ b/modules/gdnative/include/gdnative/string.h @@ -79,7 +79,7 @@ void GDAPI godot_string_new(godot_string *r_dest); void GDAPI godot_string_new_copy(godot_string *r_dest, const godot_string *p_src); void GDAPI godot_string_new_with_wide_string(godot_string *r_dest, const wchar_t *p_contents, const int p_size); -wchar_t GDAPI *godot_string_operator_index(godot_string *p_self, const godot_int p_idx); +const wchar_t GDAPI *godot_string_operator_index(godot_string *p_self, const godot_int p_idx); wchar_t GDAPI godot_string_operator_index_const(const godot_string *p_self, const godot_int p_idx); const wchar_t GDAPI *godot_string_wide_str(const godot_string *p_self); -- cgit v1.2.3