diff options
author | George Hazan <ghazan@miranda.im> | 2018-03-15 20:06:14 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-03-15 20:06:14 +0300 |
commit | 43d8271832401a84484babce14f1c69bd922d9ea (patch) | |
tree | 1100913c9fb769df49ac0cb71f0c0536a5968736 /src | |
parent | b572f4308e640ea46e9381ff642bed2950ffa888 (diff) |
last item shall be nullified anyway, even if we're removing last element
Diffstat (limited to 'src')
-rw-r--r-- | src/mir_core/src/lists.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
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;
}
|