MCPcopy Index your code
hub / github.com/google/codesearch / next

Method next

index/read.go:243–271  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

241}
242
243func (r *postReader) next() bool {
244 for r.count > 0 {
245 r.count--
246 delta64, n := binary.Uvarint(r.d)
247 delta := uint32(delta64)
248 if n <= 0 || delta == 0 {
249 corrupt()
250 }
251 r.d = r.d[n:]
252 r.fileid += delta
253 if r.restrict != nil {
254 i := 0
255 for i < len(r.restrict) && r.restrict[i] < r.fileid {
256 i++
257 }
258 r.restrict = r.restrict[i:]
259 if len(r.restrict) == 0 || r.restrict[0] != r.fileid {
260 continue
261 }
262 }
263 return true
264 }
265 // list should end with terminating 0 delta
266 if r.d != nil && (len(r.d) == 0 || r.d[0] != 0) {
267 corrupt()
268 }
269 r.fileid = ^uint32(0)
270 return false
271}
272
273func (ix *Index) PostingList(trigram uint32) []uint32 {
274 return ix.postingList(trigram, nil)

Callers 3

postingListMethod · 0.95
postingAndMethod · 0.95
postingOrMethod · 0.95

Calls 1

corruptFunction · 0.85

Tested by

no test coverage detected