From 5d32ed7f8eb6ff7e237c5b7a5d824d8fea33514a Mon Sep 17 00:00:00 2001 From: Mateusz Karbowiak <69864511+mtszkarbowiak@users.noreply.github.com> Date: Thu, 31 Oct 2024 00:49:59 +0100 Subject: [PATCH] Collections casts constiness fix --- Source/Engine/Core/Collections/BitArray.h | 4 ++-- Source/Engine/Core/Collections/Dictionary.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/Engine/Core/Collections/BitArray.h b/Source/Engine/Core/Collections/BitArray.h index f0a08d8e2..3ae573df6 100644 --- a/Source/Engine/Core/Collections/BitArray.h +++ b/Source/Engine/Core/Collections/BitArray.h @@ -215,7 +215,7 @@ 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 item = static_cast(_allocation.Get())[offset]; return (item & bitMask) != 0; } @@ -229,7 +229,7 @@ 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]; + ItemType& item = reinterpret_cast(_allocation.Get())[offset]; if (value) item |= bitMask; else diff --git a/Source/Engine/Core/Collections/Dictionary.h b/Source/Engine/Core/Collections/Dictionary.h index e9dc8f582..169b7bc3f 100644 --- a/Source/Engine/Core/Collections/Dictionary.h +++ b/Source/Engine/Core/Collections/Dictionary.h @@ -500,7 +500,7 @@ public: FindPosition(key, pos); if (pos.ObjectIndex == -1) return nullptr; - return static_cast(&_allocation.Get()[pos.ObjectIndex].Value); + return static_cast(&_allocation.Get()[pos.ObjectIndex].Value); } public: