MCPcopy
hub / github.com/google/gvisor / updateMaxGapLocal

Method updateMaxGapLocal

pkg/segment/set.go:1478–1486  ·  view source on GitHub ↗

updateMaxGapLocal updates maxGap of the calling node solely with no propagation to ancestor nodes. Precondition: trackGaps must be 1.

()

Source from the content-addressed store, hash-verified

1476//
1477// Precondition: trackGaps must be 1.
1478func (n *node) updateMaxGapLocal() {
1479 if !n.hasChildren {
1480 // Leaf node iterates its gaps.
1481 n.maxGap.Set(n.calculateMaxGapLeaf())
1482 } else {
1483 // Non-leaf node iterates its children.
1484 n.maxGap.Set(n.calculateMaxGapInternal())
1485 }
1486}
1487
1488// calculateMaxGapLeaf iterates the gaps within a leaf node and calculate the
1489// max.

Callers 2

rebalanceBeforeInsertMethod · 0.95
rebalanceAfterRemoveMethod · 0.95

Calls 3

calculateMaxGapLeafMethod · 0.95
SetMethod · 0.65

Tested by

no test coverage detected