MCPcopy Create free account
hub / github.com/ElementsProject/elements / resize_uninitialized

Method resize_uninitialized

src/prevector.h:386–399  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

384 }
385
386 inline void resize_uninitialized(size_type new_size) {
387 // resize_uninitialized changes the size of the prevector but does not initialize it.
388 // If size < new_size, the added elements must be initialized explicitly.
389 if (capacity() < new_size) {
390 change_capacity(new_size);
391 _size += new_size - size();
392 return;
393 }
394 if (new_size < size()) {
395 erase(item_ptr(new_size), end());
396 } else {
397 _size += new_size - size();
398 }
399 }
400
401 iterator erase(iterator pos) {
402 return erase(pos, pos + 1);

Callers 1

Unserialize_implFunction · 0.45

Calls 2

endFunction · 0.85
sizeFunction · 0.70

Tested by

no test coverage detected