p2p/dnsdisc: using clear builtin func (#29418)

Co-authored-by: Felix Lange <fjl@twurst.com>
pull/29451/head
cui 8 months ago committed by GitHub
parent eea0acc549
commit 2e0c5e05ba
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 10
      p2p/dnsdisc/client_test.go

@ -215,7 +215,7 @@ func TestIteratorNodeUpdates(t *testing.T) {
// Ensure RandomNode returns the new nodes after the tree is updated.
updateSomeNodes(keys, nodes)
tree2, _ := makeTestTree("n", nodes, nil)
resolver.clear()
clear(resolver)
resolver.add(tree2.ToTXT("n"))
t.Log("tree updated")
@ -256,7 +256,7 @@ func TestIteratorRootRecheckOnFail(t *testing.T) {
// Ensure RandomNode returns the new nodes after the tree is updated.
updateSomeNodes(keys, nodes)
tree2, _ := makeTestTree("n", nodes, nil)
resolver.clear()
clear(resolver)
resolver.add(tree2.ToTXT("n"))
t.Log("tree updated")
@ -447,12 +447,6 @@ func newMapResolver(maps ...map[string]string) mapResolver {
return mr
}
func (mr mapResolver) clear() {
for k := range mr {
delete(mr, k)
}
}
func (mr mapResolver) add(m map[string]string) {
maps.Copy(mr, m)
}

Loading…
Cancel
Save