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

Method SplitAfter

pkg/segment/set.go:907–912  ·  view source on GitHub ↗

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

(seg Iterator, end Key)

Source from the content-addressed store, hash-verified

905//
906// Preconditions: seg.Start() < end.
907func (s *Set) SplitAfter(seg Iterator, end Key) Iterator {
908 if seg.Range().CanSplitAt(end) {
909 seg, _ = s.SplitUnchecked(seg, end)
910 }
911 return seg
912}
913
914// Isolate ensures that the given segment's range is a subset of r by splitting
915// at r.Start and r.End if necessary, and returns an updated iterator to the

Callers 8

RemoveRangeWithMethod · 0.95
RemoveFullRangeWithMethod · 0.95
MutateRangeMethod · 0.95
MutateFullRangeMethod · 0.95
mainMethod · 0.80
releaseLockedMethod · 0.80
madviseMutateVMAsMethod · 0.80

Calls 3

SplitUncheckedMethod · 0.95
CanSplitAtMethod · 0.80
RangeMethod · 0.45

Tested by

no test coverage detected