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

Method Eval

runtime/sam/expr/bufferfilter.go:69–84  ·  view source on GitHub ↗

Eval returns true if buf matches the receiver and false otherwise.

(types super.TypeFetcher, buf []byte)

Source from the content-addressed store, hash-verified

67
68// Eval returns true if buf matches the receiver and false otherwise.
69func (b *BufferFilter) Eval(types super.TypeFetcher, buf []byte) bool {
70 switch b.op {
71 case opAnd:
72 return b.left.Eval(types, buf) && b.right.Eval(types, buf)
73 case opOr:
74 return b.left.Eval(types, buf) || b.right.Eval(types, buf)
75 case opFieldNameFinder:
76 return b.fnf.Find(types, buf)
77 case opStringCaseFinder:
78 return b.cf.Next(byteconv.UnsafeString(buf)) > -1
79 case opStringFinder:
80 return b.f.Next(byteconv.UnsafeString(buf)) > -1
81 default:
82 panic(fmt.Sprintf("BufferFilter: unknown op %d", b.op))
83 }
84}

Callers

nothing calls this directly

Calls 4

UnsafeStringFunction · 0.92
FindMethod · 0.80
EvalMethod · 0.65
NextMethod · 0.45

Tested by

no test coverage detected