MCPcopy Create free account
hub / github.com/cel-expr/cel-go / isCollectionEmpty

Function isCollectionEmpty

cel/folding.go:670–679  ·  view source on GitHub ↗
(e ast.Expr)

Source from the content-addressed store, hash-verified

668}
669
670func isCollectionEmpty(e ast.Expr) bool {
671 switch e.Kind() {
672 case ast.ListKind:
673 return e.AsList().Size() == 0
674 case ast.MapKind:
675 return e.AsMap().Size() == 0
676 default:
677 return false
678 }
679}
680
681func exprEqualsNeedle(needle, target ast.Expr) bool {
682 if needle.Kind() == ast.LiteralKind && target.Kind() == ast.LiteralKind {

Callers 2

maybePruneBranchesFunction · 0.85
constantCallMatcherFunction · 0.85

Calls 4

KindMethod · 0.65
SizeMethod · 0.65
AsListMethod · 0.65
AsMapMethod · 0.65

Tested by

no test coverage detected