MCPcopy Index your code
hub / github.com/coder/coder / intersectAll

Function intersectAll

agent/filefinder/query.go:219–232  ·  view source on GitHub ↗
(lists [][]uint32)

Source from the content-addressed store, hash-verified

217}
218
219func intersectAll(lists [][]uint32) []uint32 {
220 if len(lists) == 0 {
221 return nil
222 }
223 if len(lists) == 1 {
224 return lists[0]
225 }
226 slices.SortFunc(lists, func(a, b []uint32) int { return len(a) - len(b) })
227 result := lists[0]
228 for i := 1; i < len(lists) && len(result) > 0; i++ {
229 result = intersectSorted(result, lists[i])
230 }
231 return result
232}
233
234func mergeAndScore(cands []candidate, plan *queryPlan, params scoreParams, topK int) []Result {
235 if topK <= 0 || len(cands) == 0 {

Callers 1

searchTrigramsFunction · 0.85

Calls 1

intersectSortedFunction · 0.85

Tested by

no test coverage detected