MCPcopy Create free account
hub / github.com/apache/trafficserver / insert_before

Method insert_before

lib/swoc/include/swoc/DiscreteRange.h:1243–1256  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1241
1242template <typename METRIC, typename PAYLOAD>
1243void
1244DiscreteSpace<METRIC, PAYLOAD>::insert_before(DiscreteSpace::Node *spot, DiscreteSpace::Node *node) {
1245 if (left(spot) == nullptr) {
1246 spot->set_child(node, Direction::LEFT);
1247 } else {
1248 // If there's a left child, there's a previous node, therefore spot->_prev is valid.
1249 // Further, the previous node must be the rightmost descendant node of the left subtree
1250 // and therefore has no current right child.
1251 spot->_prev->set_child(node, Direction::RIGHT);
1252 }
1253
1254 _list.insert_before(spot, node);
1255 _root = static_cast<Node *>(node->rebalance_after_insert());
1256}
1257
1258template <typename METRIC, typename PAYLOAD>
1259void

Callers 4

blendMethod · 0.95
DiscreteRange.hFile · 0.45
insertMethod · 0.45

Calls 2

set_childMethod · 0.80

Tested by

no test coverage detected