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

Method postingAnd

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

Source from the content-addressed store, hash-verified

289}
290
291func (ix *Index) postingAnd(list []uint32, trigram uint32, restrict []uint32) []uint32 {
292 var r postReader
293 r.init(ix, trigram, restrict)
294 x := list[:0]
295 i := 0
296 for r.next() {
297 fileid := r.fileid
298 for i < len(list) && list[i] < fileid {
299 i++
300 }
301 if i < len(list) && list[i] == fileid {
302 x = append(x, fileid)
303 i++
304 }
305 }
306 return x
307}
308
309func (ix *Index) PostingOr(list []uint32, trigram uint32) []uint32 {
310 return ix.postingOr(list, trigram, nil)

Callers 2

PostingAndMethod · 0.95
postingQueryMethod · 0.95

Calls 2

initMethod · 0.95
nextMethod · 0.95

Tested by

no test coverage detected