MCPcopy Create free account
hub / github.com/Snapchat/Valdi / append

Method append

valdi_core/src/valdi_core/cpp/Utils/ValueArrayBuilder.cpp:33–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31}
32
33void ValueArrayBuilder::append(Value&& value) {
34 if (_buffer == nullptr) {
35 _buffer = ValueArray::make(kBufferMinSize);
36 } else if (_size >= _buffer->size()) {
37 auto newBuffer = ValueArray::make(_size * 2);
38 newBuffer->copy(_buffer->begin(), _buffer->end());
39
40 _buffer = std::move(newBuffer);
41 }
42
43 _buffer->emplace(_size++, std::move(value));
44}
45
46void ValueArrayBuilder::append(const Value& value) {
47 append(Value(value));

Callers

nothing calls this directly

Calls 7

ValueClass · 0.70
copyMethod · 0.65
endMethod · 0.65
appendFunction · 0.50
sizeMethod · 0.45
beginMethod · 0.45
emplaceMethod · 0.45

Tested by

no test coverage detected