| 151 | } |
| 152 | |
| 153 | InfoNode InfoNode::GetValue(std::string_view key) const { |
| 154 | if (_index < _tree->_nodeOrInfos.size()) { |
| 155 | auto &node = _tree->_nodeOrInfos[_index]; |
| 156 | if (node.Kind == InfoKind::Object) { |
| 157 | auto &umap = _tree->_mapChildren[node.Data.ChildIndex]; |
| 158 | std::string keyString(key); |
| 159 | auto it = umap.find(keyString); |
| 160 | if (it != umap.end()) { |
| 161 | return InfoNode(it->second, _tree); |
| 162 | } |
| 163 | } |
| 164 | } |
| 165 | return InfoNode(0, _tree); |
| 166 | } |