MCPcopy Create free account
hub / github.com/CodingGay/BlackDex / PutBefore

Method PutBefore

Bcore/src/main/cpp/base/safe_map.h:106–111  ·  view source on GitHub ↗

Used to insert a new mapping at a known position for better performance.

Source from the content-addressed store, hash-verified

104
105 // Used to insert a new mapping at a known position for better performance.
106 iterator PutBefore(const_iterator pos, const K& k, const V& v) {
107 // Check that we're using the correct position and the key is not in the map.
108 DCHECK(pos == map_.end() || map_.key_comp()(k, pos->first));
109 DCHECK(pos == map_.begin() || map_.key_comp()((--const_iterator(pos))->first, k));
110 return map_.emplace_hint(pos, k, v);
111 }
112 iterator PutBefore(const_iterator pos, const K& k, V&& v) {
113 // Check that we're using the correct position and the key is not in the map.
114 DCHECK(pos == map_.end() || map_.key_comp()(k, pos->first));

Callers

nothing calls this directly

Calls 3

key_compMethod · 0.80
endMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected