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

Method erase_same_node

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

Source from the content-addressed store, hash-verified

2107
2108template <typename P>
2109void btree<P>::erase_same_node(iterator begin, iterator end) {
2110 assert(begin.node == end.node);
2111 assert(end.position > begin.position);
2112
2113 node_type *node = begin.node;
2114 size_type to_erase = end.position - begin.position;
2115 if (!node->leaf()) {
2116 // Delete all children between begin and end.
2117 for (size_type i = 0; i < to_erase; ++i) {
2118 internal_clear(node->child(begin.position + i + 1));
2119 }
2120 // Rotate children after end into new positions.
2121 for (size_type i = begin.position + to_erase + 1; i <= node->count(); ++i) {
2122 node->set_child(i - to_erase, node->child(i));
2123 node->clear_child(i);
2124 }
2125 }
2126 node->remove_values_ignore_children(begin.position, to_erase,
2127 mutable_allocator());
2128
2129 // Do not need to update rightmost_, because
2130 // * either end == this->end(), and therefore node == rightmost_, and still
2131 // exists
2132 // * or end != this->end(), and therefore rightmost_ hasn't been erased, since
2133 // it wasn't covered in [begin, end)
2134}
2135
2136template <typename P>
2137auto btree<P>::erase_from_leaf_node(iterator begin, size_type to_erase)

Callers

nothing calls this directly

Calls 7

assertFunction · 0.85
leafMethod · 0.80
childMethod · 0.80
set_childMethod · 0.80
clear_childMethod · 0.80
countMethod · 0.45

Tested by

no test coverage detected