From 2ae3932fcc60fb76f2bb2cf3a91144d217a60c3c Mon Sep 17 00:00:00 2001 From: Mateusz Karbowiak <69864511+mtszkarbowiak@users.noreply.github.com> Date: Thu, 31 Oct 2024 01:06:04 +0100 Subject: [PATCH] Revert BitArray changes --- Source/Engine/Core/Collections/BitArray.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Source/Engine/Core/Collections/BitArray.h b/Source/Engine/Core/Collections/BitArray.h index 3ae573df6..1b601c72f 100644 --- a/Source/Engine/Core/Collections/BitArray.h +++ b/Source/Engine/Core/Collections/BitArray.h @@ -214,8 +214,8 @@ public: { ASSERT(index >= 0 && index < _count); const ItemType offset = index / sizeof(ItemType); - const ItemType bitMask = static_cast((int32)(1 << (index & (static_cast(sizeof(ItemType)) - 1)))); - const ItemType item = static_cast(_allocation.Get())[offset]; + const ItemType bitMask = (ItemType)(int32)(1 << (index & ((int32)sizeof(ItemType) - 1))); + const ItemType item = ((ItemType*)_allocation.Get())[offset]; return (item & bitMask) != 0; } @@ -228,12 +228,12 @@ public: { ASSERT(index >= 0 && index < _count); const ItemType offset = index / sizeof(ItemType); - const ItemType bitMask = static_cast((int32)(1 << (index & (static_cast(sizeof(ItemType)) - 1)))); - ItemType& item = reinterpret_cast(_allocation.Get())[offset]; + const ItemType bitMask = (ItemType)(int32)(1 << (index & ((int32)sizeof(ItemType) - 1))); + ItemType& item = ((ItemType*)_allocation.Get())[offset]; if (value) item |= bitMask; else - item &= ~bitMask; + item &= ~bitMask; // Clear the bit } public: