Resizes the collection to the specified size. If the size is equal or less to the current capacity no additional memory reallocation in performed. The new collection size. True if preserve collection data when changing its size, otherwise collection after resize might not contain the previous data.
| 263 | /// <param name="size">The new collection size.</param> |
| 264 | /// <param name="preserveContents">True if preserve collection data when changing its size, otherwise collection after resize might not contain the previous data.</param> |
| 265 | void Resize(const int32 size, const bool preserveContents = true) |
| 266 | { |
| 267 | if (_count <= size) |
| 268 | EnsureCapacity(size, preserveContents); |
| 269 | _count = size; |
| 270 | } |
| 271 | |
| 272 | /// <summary> |
| 273 | /// Ensures the collection has given capacity (or more). |
no test coverage detected