MCPcopy Create free account
hub / github.com/brimdata/super / intMaskFast

Method intMaskFast

runtime/vam/expr/function/networkof.go:159–176  ·  view source on GitHub ↗
(vec vector.Any, bits int)

Source from the content-addressed store, hash-verified

157}
158
159func (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
178func (n *NetworkOf) intMaskFastLoop(vec *vector.IP, index []uint32, bits int) (vector.Any, []uint32) {
179 var errs []uint32

Callers 1

intMaskMethod · 0.95

Calls 3

intMaskFastLoopMethod · 0.95
NewDictFunction · 0.92
RebuildDropTagsMethod · 0.80

Tested by

no test coverage detected