MCPcopy Create free account
hub / github.com/antchfx/xmlquery / FindEachWithBreak

Function FindEachWithBreak

query.go:138–144  ·  view source on GitHub ↗

FindEachWithBreak functions the same as FindEach but allows to break the loop by returning false from the callback function `cb`. Important: this method is deprecated, instead, use .. = range Find(){}.

(top *Node, expr string, cb func(int, *Node) bool)

Source from the content-addressed store, hash-verified

136// by returning false from the callback function `cb`.
137// Important: this method is deprecated, instead, use .. = range Find(){}.
138func FindEachWithBreak(top *Node, expr string, cb func(int, *Node) bool) {
139 for i, n := range Find(top, expr) {
140 if !cb(i, n) {
141 break
142 }
143 }
144}
145
146type NodeNavigator struct {
147 root, curr *Node

Callers 1

TestXPathFunction · 0.85

Calls 1

FindFunction · 0.85

Tested by 1

TestXPathFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…