chore: upgrade coredns version (#550)

This commit is contained in:
naison
2025-04-19 10:06:56 +08:00
committed by GitHub
parent c42e3475f9
commit c9f1ce6522
1701 changed files with 235209 additions and 29271 deletions

43
vendor/github.com/expr-lang/expr/optimizer/in_range.go generated vendored Normal file
View File

@@ -0,0 +1,43 @@
package optimizer
import (
"reflect"
. "github.com/expr-lang/expr/ast"
)
type inRange struct{}
func (*inRange) Visit(node *Node) {
switch n := (*node).(type) {
case *BinaryNode:
if n.Operator == "in" {
t := n.Left.Type()
if t == nil {
return
}
if t.Kind() != reflect.Int {
return
}
if rangeOp, ok := n.Right.(*BinaryNode); ok && rangeOp.Operator == ".." {
if from, ok := rangeOp.Left.(*IntegerNode); ok {
if to, ok := rangeOp.Right.(*IntegerNode); ok {
patchCopyType(node, &BinaryNode{
Operator: "and",
Left: &BinaryNode{
Operator: ">=",
Left: n.Left,
Right: from,
},
Right: &BinaryNode{
Operator: "<=",
Left: n.Left,
Right: to,
},
})
}
}
}
}
}
}