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

Function regexpMaxPrefix

compiler/optimizer/pruner.go:203–215  ·  view source on GitHub ↗
(s string)

Source from the content-addressed store, hash-verified

201}
202
203func regexpMaxPrefix(s string) string {
204 b := []byte(s)
205 for len(b) > 0 {
206 r, size := utf8.DecodeLastRune(b)
207 if r == utf8.MaxRune {
208 // remove last character and do this again
209 b = b[:len(b)-size]
210 } else {
211 return string(utf8.AppendRune(b[:len(b)-size], r+1))
212 }
213 }
214 return ""
215}
216
217func metaPrunerBinaryExpr(e *dag.BinaryExpr) dag.Expr {
218 switch e.Op {

Callers 1

newMetadataPrunerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected