MCPcopy Index your code
hub / github.com/dropbox/godropbox / isAny

Method isAny

container/bitarray/bitarray.go:115–145  ·  view source on GitHub ↗
(
	opBits func(v uint64, mask uint64) bool,
	opWord func(v uint64) bool,
	i0 int,
	i1 int,
)

Source from the content-addressed store, hash-verified

113}
114
115func (b *BitArray) isAny(
116 opBits func(v uint64, mask uint64) bool,
117 opWord func(v uint64) bool,
118 i0 int,
119 i1 int,
120) bool {
121 idx0, off0 := ioff(i0)
122 idx1, off1 := ioff(i1)
123 if idx0 == idx1 {
124 mask := upperMask(off0) & lowerMask(off1)
125 return opBits(b.vs[idx0], mask)
126 }
127 if off0 != 0 {
128 if opBits(b.vs[idx0], upperMask(off0)) {
129 return true
130 }
131 idx0++
132 }
133 if off1 != 63 {
134 if opBits(b.vs[idx1], lowerMask(off1)) {
135 return true
136 }
137 idx1--
138 }
139 for idx := idx0; idx <= idx1; idx++ {
140 if opWord(b.vs[idx]) {
141 return true
142 }
143 }
144 return false
145}
146
147func opRange(
148 opBits func(idx int, off1 uint32, off2 uint32),

Callers 2

IsAnySetMethod · 0.95
IsAnyClearMethod · 0.95

Calls 3

ioffFunction · 0.85
upperMaskFunction · 0.85
lowerMaskFunction · 0.85

Tested by

no test coverage detected