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

Method postingOr

index/read.go:313–331  ·  view source on GitHub ↗
(list []uint32, trigram uint32, restrict []uint32)

Source from the content-addressed store, hash-verified

311}
312
313func (ix *Index) postingOr(list []uint32, trigram uint32, restrict []uint32) []uint32 {
314 var r postReader
315 r.init(ix, trigram, restrict)
316 x := make([]uint32, 0, len(list)+r.max())
317 i := 0
318 for r.next() {
319 fileid := r.fileid
320 for i < len(list) && list[i] < fileid {
321 x = append(x, list[i])
322 i++
323 }
324 x = append(x, fileid)
325 if i < len(list) && list[i] == fileid {
326 i++
327 }
328 }
329 x = append(x, list[i:]...)
330 return x
331}
332
333func (ix *Index) PostingQuery(q *Query) []uint32 {
334 return ix.postingQuery(q, nil)

Callers 2

PostingOrMethod · 0.95
postingQueryMethod · 0.95

Calls 3

initMethod · 0.95
maxMethod · 0.95
nextMethod · 0.95

Tested by

no test coverage detected