MCPcopy Create free account
hub / github.com/Norbyte/bg3se / set

Method set

CoreLib/Base/SparseArray.h:188–203  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

186 SparsePagedArray(SparsePagedArray &&) = delete;
187
188 void set(uint32_t index, T const& value)
189 {
190 if (mask_[index]) {
191 // Value in slot already constructed
192 values_[index] = value;
193 } else {
194 // Need to construct in place, slot is empty
195 if (index >= mask_.size()) {
196 mask_.resize(index + 1);
197 values_.reallocExtern<TAllocator>(index + 1, mask_.allocator());
198 }
199
200 mask_.set(index);
201 new (&values_[index]) T(value);
202 }
203 }
204
205 void set(uint32_t index, T&& value)
206 {

Callers

nothing calls this directly

Calls 3

sizeMethod · 0.45
resizeMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected