MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / Set

Function Set

Source/Engine/Core/Collections/BitArray.h:223–233  ·  view source on GitHub ↗

Sets the item at the given index. The index of the item. The value to set.

Source from the content-addressed store, hash-verified

221 /// <param name="index">The index of the item.</param>
222 /// <param name="value">The value to set.</param>
223 void Set(const int32 index, const bool value)
224 {
225 ASSERT(index >= 0 && index < _count);
226 const ItemType offset = index / 64;
227 const ItemType bitMask = 1ull << (index & 63ull);
228 ItemType& item = ((ItemType*)_allocation.Get())[offset];
229 if (value)
230 item |= bitMask; // Set the bit
231 else
232 item &= ~bitMask; // Unset the bit
233 }
234
235public:
236 /// <summary>

Callers 1

AddFunction · 0.70

Calls 1

GetMethod · 0.45

Tested by

no test coverage detected