Merge pull request #565 from jvoisin/prez

perf: presize set in appendWithoutDuplicates to final expected size
This commit is contained in:
Martin Angers
2026-06-01 11:32:54 -04:00
committed by GitHub
+1 -1
View File
@@ -143,7 +143,7 @@ func appendWithoutDuplicates(target []*html.Node, nodes []*html.Node, targetSet
// if a targetSet is passed, then assume it is reliable, otherwise create one
// and initialize it with the current target contents.
if targetSet == nil {
targetSet = make(map[*html.Node]bool, len(target))
targetSet = make(map[*html.Node]bool, len(target)+len(nodes))
for _, n := range target {
targetSet[n] = true
}