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

Function opRange

container/bitarray/bitarray.go:147–170  ·  view source on GitHub ↗
(
	opBits func(idx int, off1 uint32, off2 uint32),
	opWord func(idx int),
	i0 int,
	i1 int,
)

Source from the content-addressed store, hash-verified

145}
146
147func opRange(
148 opBits func(idx int, off1 uint32, off2 uint32),
149 opWord func(idx int),
150 i0 int,
151 i1 int,
152) {
153 idx0, off0 := ioff(i0)
154 idx1, off1 := ioff(i1)
155 if idx0 == idx1 {
156 opBits(idx0, off0, off1)
157 return
158 }
159 if off0 != 0 {
160 opBits(idx0, off0, 63)
161 idx0++
162 }
163 if off1 != 63 {
164 opBits(idx1, 0, off1)
165 idx1--
166 }
167 for idx := idx0; idx <= idx1; idx++ {
168 opWord(idx)
169 }
170}
171
172func (b *BitArray) setBits(idx int, off1 uint32, off2 uint32) {
173 b.vs[idx] |= upperMask(off1) & lowerMask(off2)

Callers 2

SetRangeMethod · 0.85
ClearRangeMethod · 0.85

Calls 1

ioffFunction · 0.85

Tested by

no test coverage detected