(vec vector.Any, bits int)
| 157 | } |
| 158 | |
| 159 | func (n *NetworkOf) intMaskFast(vec vector.Any, bits int) (vector.Any, []uint32) { |
| 160 | switch vec := vec.(type) { |
| 161 | case *vector.IP: |
| 162 | return n.intMaskFastLoop(vec, nil, bits) |
| 163 | case *vector.View: |
| 164 | return n.intMaskFastLoop(vec.Any.(*vector.IP), vec.Index, bits) |
| 165 | case *vector.Dict: |
| 166 | nets, derrs := n.intMaskFastLoop(vec.Any.(*vector.IP), nil, bits) |
| 167 | index, counts := vec.Index, vec.Counts |
| 168 | var errs []uint32 |
| 169 | if len(derrs) > 0 { |
| 170 | index, counts, errs = vec.RebuildDropTags(derrs...) |
| 171 | } |
| 172 | return vector.NewDict(nets, index, counts), errs |
| 173 | default: |
| 174 | panic(vec) |
| 175 | } |
| 176 | } |
| 177 | |
| 178 | func (n *NetworkOf) intMaskFastLoop(vec *vector.IP, index []uint32, bits int) (vector.Any, []uint32) { |
| 179 | var errs []uint32 |
no test coverage detected