(a, b []uint32)
| 196 | } |
| 197 | |
| 198 | func intersectSorted(a, b []uint32) []uint32 { |
| 199 | if len(a) == 0 || len(b) == 0 { |
| 200 | return nil |
| 201 | } |
| 202 | var result []uint32 |
| 203 | ai, bi := 0, 0 |
| 204 | for ai < len(a) && bi < len(b) { |
| 205 | switch { |
| 206 | case a[ai] < b[bi]: |
| 207 | ai++ |
| 208 | case a[ai] > b[bi]: |
| 209 | bi++ |
| 210 | default: |
| 211 | result = append(result, a[ai]) |
| 212 | ai++ |
| 213 | bi++ |
| 214 | } |
| 215 | } |
| 216 | return result |
| 217 | } |
| 218 | |
| 219 | func intersectAll(lists [][]uint32) []uint32 { |
| 220 | if len(lists) == 0 { |