Merge pull request #553 from jvoisin/slyce

perf: call Match/isInSlice directly in Until traversal helpers
This commit is contained in:
Martin Angers
2026-05-26 09:00:57 -04:00
committed by GitHub
+2 -6
View File
@@ -588,13 +588,9 @@ func getSiblingNodes(nodes []*html.Node, st siblingType, untilm Matcher, untilNo
if st == siblingNextUntil || st == siblingPrevUntil {
f = func(n *html.Node) bool {
if untilm != nil {
// Matcher-based condition
sel := newSingleSelection(n, nil)
return sel.IsMatcher(untilm)
return untilm.Match(n)
} else if len(untilNodes) > 0 {
// Nodes-based condition
sel := newSingleSelection(n, nil)
return sel.IsNodes(untilNodes...)
return isInSlice(untilNodes, n)
}
return false
}