Collections casts constiness fix

This commit is contained in:
Mateusz Karbowiak
2024-10-31 00:49:59 +01:00
parent fbb840dff3
commit 5d32ed7f8e
2 changed files with 3 additions and 3 deletions

View File

@@ -215,7 +215,7 @@ public:
ASSERT(index >= 0 && index < _count);
const ItemType offset = index / sizeof(ItemType);
const ItemType bitMask = static_cast<ItemType>((int32)(1 << (index & (static_cast<int32>(sizeof(ItemType)) - 1))));
const ItemType item = static_cast<ItemType*>(_allocation.Get())[offset];
const ItemType item = static_cast<const ItemType*>(_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<ItemType>((int32)(1 << (index & (static_cast<int32>(sizeof(ItemType)) - 1))));
ItemType& item = reinterpret_cast<ItemType*>(_allocation.Get())[offset];
ItemType& item = reinterpret_cast<ItemType&>(_allocation.Get())[offset];
if (value)
item |= bitMask;
else

View File

@@ -500,7 +500,7 @@ public:
FindPosition(key, pos);
if (pos.ObjectIndex == -1)
return nullptr;
return static_cast<ValueType*>(&_allocation.Get()[pos.ObjectIndex].Value);
return static_cast<const ValueType*>(&_allocation.Get()[pos.ObjectIndex].Value);
}
public: