Fix regression from 087cfd7a8c on hashset item duplicate re-add

This commit is contained in:
Wojtek Figat
2023-11-03 19:07:16 +01:00
parent da72dd4806
commit 6f1ee382b5

View File

@@ -702,8 +702,9 @@ private:
FindPositionResult pos;
FindPosition(key, pos);
// Ensure key is unknown
ASSERT(pos.ObjectIndex == -1 && "That key has been already added to the dictionary.");
// Check if object has been already added
if (pos.ObjectIndex != -1)
return nullptr;
// Insert
ASSERT(pos.FreeSlotIndex != -1);