func newSargableUnary(expr expression.UnaryFunction) *sargableUnary { rv := &sargableUnary{} rv.test = func(expr2 expression.Expression) (bool, error) { return expr.Operand().EquivalentTo(expr2), nil } return rv }
func newSargValued(expr expression.UnaryFunction) *sargValued { rv := &sargValued{} rv.sarg = func(expr2 expression.Expression) (Spans, error) { if expr.EquivalentTo(expr2) { return _SELF_SPANS, nil } if !expr.Operand().EquivalentTo(expr2) { return nil, nil } return _VALUED_SPANS, nil } return rv }