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

Method SplitBefore

pkg/segment/set.go:886–891  ·  view source on GitHub ↗

SplitBefore ensures that the given segment's start is at least start by splitting at start if necessary, and returns an updated iterator to the bounded segment. All existing iterators (including seg, but not including the returned iterator) are invalidated. SplitBefore is usually when mutating segm

(seg Iterator, start Key)

Source from the content-addressed store, hash-verified

884//
885// Preconditions: start < seg.End().
886func (s *Set) SplitBefore(seg Iterator, start Key) Iterator {
887 if seg.Range().CanSplitAt(start) {
888 _, seg = s.SplitUnchecked(seg, start)
889 }
890 return seg
891}
892
893// SplitAfter ensures that the given segment's end is at most end by splitting
894// at end if necessary, and returns an updated iterator to the bounded segment.

Callers 3

RemoveFullRangeWithMethod · 0.95
MutateFullRangeMethod · 0.95

Calls 3

SplitUncheckedMethod · 0.95
CanSplitAtMethod · 0.80
RangeMethod · 0.45

Tested by

no test coverage detected