(lists [][]uint32)
| 217 | } |
| 218 | |
| 219 | func 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 | |
| 234 | func mergeAndScore(cands []candidate, plan *queryPlan, params scoreParams, topK int) []Result { |
| 235 | if topK <= 0 || len(cands) == 0 { |
no test coverage detected