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

Method do

query.go:786–802  ·  view source on GitHub ↗
(t iterator)

Source from the content-addressed store, hash-verified

784}
785
786func (f *filterQuery) do(t iterator) bool {
787 val := reflect.ValueOf(f.Predicate.Evaluate(t))
788 switch val.Kind() {
789 case reflect.Bool:
790 return val.Bool()
791 case reflect.String:
792 return len(val.String()) > 0
793 case reflect.Float64:
794 pt := getNodePosition(f.Input)
795 return int(val.Float()) == pt
796 default:
797 if f.Predicate != nil {
798 return f.Predicate.Select(t) != nil
799 }
800 }
801 return false
802}
803
804func (f *filterQuery) position() int {
805 return f.posit

Callers 1

SelectMethod · 0.95

Calls 4

getNodePositionFunction · 0.85
EvaluateMethod · 0.65
StringMethod · 0.65
SelectMethod · 0.65

Tested by

no test coverage detected