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

Function NewBufferFilterForStringCase

runtime/sam/expr/bufferfilter.go:53–66  ·  view source on GitHub ↗
(pattern string)

Source from the content-addressed store, hash-verified

51}
52
53func NewBufferFilterForStringCase(pattern string) *BufferFilter {
54 if len(pattern) < 2 {
55 // Very short patterns are unprofitable.
56 return nil
57 }
58 for _, r := range pattern {
59 if r >= utf8.RuneSelf {
60 // stringCaseFinder is sensitive to case for letters
61 // with multibyte UTF-8 encodings.
62 return nil
63 }
64 }
65 return &BufferFilter{op: opStringCaseFinder, cf: stringsearch.NewCaseFinder(pattern)}
66}
67
68// Eval returns true if buf matches the receiver and false otherwise.
69func (b *BufferFilter) Eval(types super.TypeFetcher, buf []byte) bool {

Callers 1

CompileBufferFilterFunction · 0.92

Calls 1

NewCaseFinderFunction · 0.92

Tested by

no test coverage detected