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.
| 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 |
nothing calls this directly
no test coverage detected