From 4a5c36352c9db1be5a9fa8390eca9c57e905fc58 Mon Sep 17 00:00:00 2001 From: Azaezel Date: Tue, 13 Mar 2018 02:12:59 -0500 Subject: [PATCH] remove inside a remove after a remove... yeah.... No. --- Engine/source/core/tSparseArray.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Engine/source/core/tSparseArray.h b/Engine/source/core/tSparseArray.h index 5a15b1f81..4f3800447 100644 --- a/Engine/source/core/tSparseArray.h +++ b/Engine/source/core/tSparseArray.h @@ -113,14 +113,14 @@ inline void SparseArray::insert(T* pObject, U32 key) template inline T* SparseArray::remove(U32 key) { - U32 remove = key % mModulus; - Node* probe = &mSentryTables[remove]; + U32 sentryID = key % mModulus; + Node* probe = &mSentryTables[sentryID]; while (probe->next != NULL) { if (probe->next->key == key) { - Node* remove = probe->next; - T* pReturn = remove->pObject; - probe->next = remove->next; - delete remove; + Node* nextProbe = probe->next; + T* pReturn = nextProbe->pObject; + probe->next = nextProbe->next; + delete nextProbe; return pReturn; } probe = probe->next;