MCPcopy Create free account
hub / github.com/apache/impala / FindOrInsert

Function FindOrInsert

be/src/util/container-util.h:195–201  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

193
194template <typename K, typename V>
195V* FindOrInsert(std::map<K,V>* m, const K& key, const V& default_val) {
196 typename std::map<K,V>::iterator it = m->find(key);
197 if (it == m->end()) {
198 it = m->insert(std::make_pair(key, default_val)).first;
199 }
200 return &it->second;
201}
202
203template <typename K, typename V>
204V* FindOrInsert(std::unordered_map<K,V>* m, const K& key, const V& default_val) {

Callers 6

SelectExecutorOnHostMethod · 0.85
UpdateHdfsSplitStatsMethod · 0.85
UpdateMethod · 0.85
AddDerivedCounterMethod · 0.85

Calls 3

findMethod · 0.45
endMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected