MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / AsMap

Method AsMap

Util/src/InfoTree/InfoNode.cpp:139–151  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

137}
138
139std::unordered_map<std::string, InfoNode> InfoNode::AsMap() const {
140 std::unordered_map<std::string, InfoNode> umap;
141 if (_index < _tree->_nodeOrInfos.size()) {
142 auto &node = _tree->_nodeOrInfos[_index];
143 if (node.Kind == InfoKind::Object) {
144 auto &innerUmap = _tree->_mapChildren[node.Data.ChildIndex];
145 for (auto &p: innerUmap) {
146 umap.insert({p.first, InfoNode(p.second, _tree)});
147 }
148 }
149 }
150 return umap;
151}
152
153InfoNode InfoNode::GetValue(std::string_view key) const {
154 if (_index < _tree->_nodeOrInfos.size()) {

Callers 1

MakeNameStyleFunction · 0.80

Calls 3

InfoNodeClass · 0.85
sizeMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected