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)
| 884 | // |
| 885 | // Preconditions: start < seg.End(). |
| 886 | func (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. |
no test coverage detected