MCPcopy Create free account
hub / github.com/antchfx/xpath / Evaluate

Method Evaluate

query.go:1108–1122  ·  view source on GitHub ↗
(t iterator)

Source from the content-addressed store, hash-verified

1106}
1107
1108func (b *booleanQuery) Evaluate(t iterator) interface{} {
1109 n := t.Current().Copy()
1110
1111 m := b.Left.Evaluate(t)
1112 left := asBool(t, m)
1113 if b.IsOr && left {
1114 return true
1115 } else if !b.IsOr && !left {
1116 return false
1117 }
1118
1119 t.Current().MoveTo(n)
1120 m = b.Right.Evaluate(t)
1121 return asBool(t, m)
1122}
1123
1124func (b *booleanQuery) Clone() query {
1125 return &booleanQuery{IsOr: b.IsOr, Left: b.Left.Clone(), Right: b.Right.Clone()}

Callers

nothing calls this directly

Calls 5

asBoolFunction · 0.85
CopyMethod · 0.65
CurrentMethod · 0.65
EvaluateMethod · 0.65
MoveToMethod · 0.65

Tested by

no test coverage detected