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

Function isIn

recordbuilder.go:128–148  ·  view source on GitHub ↗

check if fieldname is "in" one of the fields in fis, or if one of fis is "in" fieldname, where "in" means "equal or is a suffix of".

(fieldname field.Path, fis []fieldInfo)

Source from the content-addressed store, hash-verified

126// check if fieldname is "in" one of the fields in fis, or if
127// one of fis is "in" fieldname, where "in" means "equal or is a suffix of".
128func isIn(fieldname field.Path, fis []fieldInfo) bool {
129 // check if fieldname of splits is "in" one of fis
130 for i := range fieldname {
131 sub := fieldname[:i+1]
132 for _, fi := range fis {
133 if sub.Equal(fi.field) {
134 return true
135 }
136 }
137 }
138 // check if one of fis is "in" fieldname
139 for _, fi := range fis {
140 for i := range fi.field {
141 prefix := fi.field[:i+1]
142 if prefix.Equal(fieldname) {
143 return true
144 }
145 }
146 }
147 return false
148}
149
150func (r *RecordBuilder) Reset() {
151 r.builder.Reset()

Callers 1

NewRecordBuilderFunction · 0.85

Calls 1

EqualMethod · 0.45

Tested by

no test coverage detected