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

Function SearchByPredicate

runtime/sam/expr/filter.go:20–29  ·  view source on GitHub ↗
(pred Boolean, e Evaluator)

Source from the content-addressed store, hash-verified

18}
19
20func SearchByPredicate(pred Boolean, e Evaluator) Evaluator {
21 return &searchByPred{
22 pred: pred,
23 expr: e,
24 fnm: NewFieldNameMatcher(func(b []byte) bool {
25 val := super.NewValue(super.TypeString, b)
26 return pred(val).Ptr().AsBool()
27 }),
28 }
29}
30
31func (s *searchByPred) Eval(val super.Value) super.Value {
32 if s.expr != nil {

Callers 1

compileRegexpSearchMethod · 0.92

Calls 4

NewValueFunction · 0.92
NewFieldNameMatcherFunction · 0.85
AsBoolMethod · 0.80
PtrMethod · 0.80

Tested by

no test coverage detected