MCPcopy Create free account
hub / github.com/ceph/ceph / insert_hint_multi

Method insert_hint_multi

src/include/cpp-btree/btree.h:1921–1940  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1919template <typename P>
1920template <typename ValueType>
1921auto btree<P>::insert_hint_multi(iterator position, ValueType &&v) -> iterator {
1922 if (!empty()) {
1923 const key_type &key = params_type::key(v);
1924 if (position == end() || !compare_keys(position.key(), key)) {
1925 iterator prev = position;
1926 if (position == begin() || !compare_keys(key, (--prev).key())) {
1927 // prev.key() <= key <= position.key()
1928 return internal_emplace(position, std::forward<ValueType>(v));
1929 }
1930 } else {
1931 iterator next = position;
1932 ++next;
1933 if (next == end() || !compare_keys(next.key(), key)) {
1934 // position.key() < key <= next.key()
1935 return internal_emplace(next, std::forward<ValueType>(v));
1936 }
1937 }
1938 }
1939 return insert_multi(std::forward<ValueType>(v));
1940}
1941
1942template <typename P>
1943template <typename InputIterator>

Callers 2

insertMethod · 0.80
emplace_hintMethod · 0.80

Calls 4

emptyFunction · 0.50
endFunction · 0.50
beginFunction · 0.50
keyMethod · 0.45

Tested by

no test coverage detected