MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / resize

Method resize

source/core/StarSmallVector.hpp:195–202  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

193
194template <typename Element, size_t MaxStackSize>
195void SmallVector<Element, MaxStackSize>::resize(size_t size, Element const& e) {
196 reserve(size);
197
198 for (size_t i = this->size(); i > size; --i)
199 pop_back();
200 for (size_t i = this->size(); i < size; ++i)
201 emplace_back(e);
202}
203
204template <typename Element, size_t MaxStackSize>
205void SmallVector<Element, MaxStackSize>::reserve(size_t newCapacity) {

Callers

nothing calls this directly

Calls 2

sizeMethod · 0.95
reserveFunction · 0.85

Tested by

no test coverage detected