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

Method EnsureCapacity

Source/Engine/Core/Collections/Array.h:420–427  ·  view source on GitHub ↗

Ensures the collection has given capacity (or more). The minimum capacity. True if preserve collection data when changing its size, otherwise collection after resize will be empty.

Source from the content-addressed store, hash-verified

418 /// <param name="minCapacity">The minimum capacity.</param>
419 /// <param name="preserveContents">True if preserve collection data when changing its size, otherwise collection after resize will be empty.</param>
420 void EnsureCapacity(const int32 minCapacity, const bool preserveContents = true)
421 {
422 if (_capacity < minCapacity)
423 {
424 const int32 capacity = _allocation.CalculateCapacityGrow(_capacity, minCapacity);
425 SetCapacity(capacity, preserveContents);
426 }
427 }
428
429 /// <summary>
430 /// Sets all items to the given value

Callers

nothing calls this directly

Calls 2

SetCapacityFunction · 0.70
CalculateCapacityGrowMethod · 0.45

Tested by

no test coverage detected