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

Function ComputeIfAbsentReturnAbsense

be/src/gutil/map-util.h:946–953  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

944}
945template <class MapContainer, typename Function>
946std::pair<typename MapContainer::mapped_type* const, bool>
947ComputeIfAbsentReturnAbsense(MapContainer* container,
948 const typename MapContainer::key_type& key,
949 Function compute_func) {
950 return ComputePairIfAbsentReturnAbsense(container, key, [&key, &compute_func] {
951 return std::make_pair(key, compute_func());
952 });
953};
954
955// Like the above but doesn't return a pair, just returns a pointer to the value.
956// Example usage:

Callers 3

TrackRpcUnlockedMethod · 0.85
TESTFunction · 0.85
ComputeIfAbsentFunction · 0.85

Calls 1

Tested by 1

TESTFunction · 0.68