search the list for the first interval that matches the predicate. If no interval matches, it will return the list length.
(l List, t Predicate)
| 46 | // search the list for the first interval that matches the predicate. |
| 47 | // If no interval matches, it will return the list length. |
| 48 | func search(l List, t Predicate) int { |
| 49 | i := 0 |
| 50 | j := l.Length() |
| 51 | for i < j { |
| 52 | h := i + (j-i)/2 |
| 53 | if !t(l.GetSpan(h)) { |
| 54 | i = h + 1 |
| 55 | } else { |
| 56 | j = h |
| 57 | } |
| 58 | } |
| 59 | return i |
| 60 | } |
| 61 | |
| 62 | // intersect a span with a list, calculating the intersection span and interval range |
| 63 | func (s *intersection) intersect(l List, span U64Span, expand bool) { |
no test coverage detected