From 43d8271832401a84484babce14f1c69bd922d9ea Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 15 Mar 2018 20:06:14 +0300 Subject: last item shall be nullified anyway, even if we're removing last element --- src/mir_core/src/lists.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/mir_core') diff --git a/src/mir_core/src/lists.cpp b/src/mir_core/src/lists.cpp index 8a513ea791..e6449fd468 100644 --- a/src/mir_core/src/lists.cpp +++ b/src/mir_core/src/lists.cpp @@ -207,11 +207,9 @@ MIR_CORE_DLL(int) List_Remove(SortedList* p_list, int index) return 0; p_list->realCount--; - if (p_list->realCount > index) { + if (p_list->realCount > index) memmove(p_list->items + index, p_list->items + index + 1, sizeof(void*)*(p_list->realCount - index)); - p_list->items[p_list->realCount] = nullptr; - } - + p_list->items[p_list->realCount] = nullptr; return 1; } -- cgit v1.2.3