MCPcopy Create free account
hub / github.com/google/gapid / search

Function search

core/math/interval/algorithm.go:48–60  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

46// search the list for the first interval that matches the predicate.
47// If no interval matches, it will return the list length.
48func 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
63func (s *intersection) intersect(l List, span U64Span, expand bool) {

Callers 3

MainActivityMethod · 0.85
intersectMethod · 0.85
SearchFunction · 0.85

Calls 2

LengthMethod · 0.65
GetSpanMethod · 0.65

Tested by

no test coverage detected