From 5fdbed2b56f9d1f738f4ed499efafd316c1eb2f2 Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Sun, 14 Dec 2025 22:41:00 +0100 Subject: [PATCH] Minor codestyle adjustments --- Source/Engine/Core/Collections/HashSetBase.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/Engine/Core/Collections/HashSetBase.h b/Source/Engine/Core/Collections/HashSetBase.h index 58f1702c2..94bbd149d 100644 --- a/Source/Engine/Core/Collections/HashSetBase.h +++ b/Source/Engine/Core/Collections/HashSetBase.h @@ -408,14 +408,14 @@ protected: } else { - const int32 elementsCount = _elementsCount; // Rebuild entire table completely + const int32 elementsCount = _elementsCount; const int32 oldSize = _size; AllocationData oldAllocation; AllocationUtils::MoveToEmpty(oldAllocation, _allocation, oldSize, oldSize); _allocation.Allocate(_size); BucketType* data = _allocation.Get(); - for (int32 i = 0; i < _size; ++i) + for (int32 i = 0; i < oldSize; ++i) data[i]._state = HashSetBucketState::Empty; BucketType* oldData = oldAllocation.Get(); FindPositionResult pos; @@ -430,8 +430,8 @@ protected: // Grow and retry to handle pathological cases (eg. heavy collisions) EnsureCapacity(_size + 1, true); FindPosition(oldBucket.GetKey(), pos); + ASSERT(pos.FreeSlotIndex != -1); } - ASSERT(pos.FreeSlotIndex != -1); BucketType& bucket = _allocation.Get()[pos.FreeSlotIndex]; bucket = MoveTemp(oldBucket); }