MCPcopy Create free account
hub / github.com/bytedance/sonic-cpp / EndArray

Method EndArray

include/sonic/dom/handler.h:166–180  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

164 }
165
166 sonic_force_inline bool EndArray(uint32_t count) {
167 NodeType &arr = st_[parent_];
168 size_t old = arr.o.next.ofs;
169 arr.setLength(count, kArray);
170 if (count) {
171 arr.setChildren(arr.template containerMalloc<NodeType>(count, *alloc_));
172 internal::Xmemcpy<sizeof(NodeType)>(
173 (void *)arr.getArrChildrenFirstUnsafe(), (void *)(&arr + 1), count);
174 } else {
175 arr.setChildren(nullptr);
176 }
177 np_ = parent_ + 1;
178 parent_ = old;
179 return true;
180 }
181
182 private:
183 friend class GenericDocument<NodeType>;

Callers 2

parseImplMethod · 0.45

Calls 2

setChildrenMethod · 0.80

Tested by

no test coverage detected