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)
| 905 | // |
| 906 | // Preconditions: seg.Start() < end. |
| 907 | func (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 |
no test coverage detected