MCPcopy Create free account
hub / github.com/alibaba/PhotonLibOS / get_root

Method get_root

ecosystem/simple_dom.cpp:187–193  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

185 delete _root;
186 }
187 JNode* get_root() {
188 assert(_nodes.size() == 1);
189 assert(_nodes.front().size() == 1);
190 _root->set_children(std::move(_nodes.front().front()._children));
191 DEFER(_root = nullptr);
192 return _root;
193 }
194 void emplace_back(const char* s, size_t length, uint8_t type) {
195 str val{s, length}; // _key may be empty()
196 _nodes.back().emplace_back(_key, val, _root);

Callers 1

parse_jsonFunction · 0.45

Calls 3

set_childrenMethod · 0.80
sizeMethod · 0.45
frontMethod · 0.45

Tested by

no test coverage detected