MCPcopy
hub / github.com/PuerkitoBio/goquery / FilterSelection

Method FilterSelection

filter.go:57–62  ·  view source on GitHub ↗

FilterSelection reduces the set of matched elements to those that match a node in the specified Selection object. It returns a new Selection object for this subset of elements.

(sel *Selection)

Source from the content-addressed store, hash-verified

55// node in the specified Selection object.
56// It returns a new Selection object for this subset of elements.
57func (s *Selection) FilterSelection(sel *Selection) *Selection {
58 if sel == nil {
59 return pushStack(s, winnowNodes(s, nil, true))
60 }
61 return pushStack(s, winnowNodes(s, sel.Nodes, true))
62}
63
64// NotSelection removes elements from the Selection that match a node in the specified
65// Selection object. It returns a new Selection object with the matching elements removed.

Callers 6

IntersectionMethod · 0.95
IsSelectionMethod · 0.95
BenchmarkFilterSelectionFunction · 0.80
TestFilterSelectionFunction · 0.80
TestFilterSelectionNilFunction · 0.80

Calls 2

pushStackFunction · 0.85
winnowNodesFunction · 0.85

Tested by 4

BenchmarkFilterSelectionFunction · 0.64
TestFilterSelectionFunction · 0.64
TestFilterSelectionNilFunction · 0.64