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

Method toArray

valdi_core/src/valdi_core/cpp/Utils/Marshaller.cpp:140–155  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

138}
139
140Ref<ValueArray> Marshaller::toArray() {
141 auto n = size();
142
143 auto out = ValueArray::make(static_cast<size_t>(n));
144
145 for (int i = 0; i < n; i++) {
146 auto value = get(i);
147 if (!_exceptionTracker) {
148 return nullptr;
149 }
150
151 out->emplace(static_cast<size_t>(i), std::move(value));
152 }
153
154 return out;
155}
156
157std::string Marshaller::toString(bool indent) {
158 auto array = toArray();

Callers

nothing calls this directly

Calls 3

sizeFunction · 0.50
getFunction · 0.50
emplaceMethod · 0.45

Tested by

no test coverage detected