mirror of
https://github.com/PuerkitoBio/goquery.git
synced 2026-10-19 16:15:33 +00:00
Merge pull request #565 from jvoisin/prez
perf: presize set in appendWithoutDuplicates to final expected size
This commit is contained in:
+1
-1
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user