MCPcopy Create free account
hub / github.com/apache/trafficserver / get

Method get

lib/yamlcpp/include/yaml-cpp/node/detail/impl.h:118–139  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

116// indexing
117template <typename Key>
118inline node* node_data::get(const Key& key,
119 shared_memory_holder pMemory) const {
120 switch (m_type) {
121 case NodeType::Map:
122 break;
123 case NodeType::Undefined:
124 case NodeType::Null:
125 return nullptr;
126 case NodeType::Sequence:
127 if (node* pNode = get_idx<Key>::get(m_sequence, key, pMemory))
128 return pNode;
129 return nullptr;
130 case NodeType::Scalar:
131 throw BadSubscript(m_mark, key);
132 }
133
134 auto it = std::find_if(m_map.begin(), m_map.end(), [&](const kv_pair m) {
135 return m.first->equals(key, pMemory);
136 });
137
138 return it != m_map.end() ? it->second : nullptr;
139}
140
141template <typename Key>
142inline node& node_data::get(const Key& key, shared_memory_holder pMemory) {

Callers 1

operator[]Method · 0.45

Calls 5

BadSubscriptFunction · 0.85
equalsMethod · 0.80
getFunction · 0.50
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected