File tree Expand file tree Collapse file tree
Source/Engine/Core/Collections Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,7 +16,6 @@ API_CLASS(InBuild) class BitArray
1616public:
1717 using ItemType = uint64;
1818 using AllocationData = typename AllocationType::template Data<ItemType>;
19- static constexpr int32 ItemBitCount = 64 ;
2019
2120private:
2221 int32 _count;
@@ -210,8 +209,8 @@ API_CLASS(InBuild) class BitArray
210209 bool Get (const int32 index) const
211210 {
212211 ASSERT (index >= 0 && index < _count);
213- const ItemType offset = index / ItemBitCount ;
214- const ItemType bitMask = (ItemType)( 1 << (index & (ItemBitCount - 1 )) );
212+ const ItemType offset = index / 64 ;
213+ const ItemType bitMask = 1ull << (index & 63ull );
215214 const ItemType item = ((ItemType*)_allocation.Get ())[offset];
216215 return (item & bitMask) != 0 ;
217216 }
@@ -224,8 +223,8 @@ API_CLASS(InBuild) class BitArray
224223 void Set (const int32 index, const bool value)
225224 {
226225 ASSERT (index >= 0 && index < _count);
227- const ItemType offset = index / ItemBitCount ;
228- const ItemType bitMask = (ItemType)( 1 << (index & (ItemBitCount - 1 )) );
226+ const ItemType offset = index / 64 ;
227+ const ItemType bitMask = 1ull << (index & 63ull );
229228 ItemType& item = ((ItemType*)_allocation.Get ())[offset];
230229 if (value)
231230 item |= bitMask; // Set the bit
You can’t perform that action at this time.
0 commit comments