From 2e0c5e05ba355a722eb6eb9bc338de4949eee20d Mon Sep 17 00:00:00 2001 From: cui <523516579@qq.com> Date: Thu, 4 Apr 2024 18:19:48 +0800 Subject: [PATCH] p2p/dnsdisc: using clear builtin func (#29418) Co-authored-by: Felix Lange --- p2p/dnsdisc/client_test.go | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/p2p/dnsdisc/client_test.go b/p2p/dnsdisc/client_test.go index 77bfd8c131..01912e1eab 100644 --- a/p2p/dnsdisc/client_test.go +++ b/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) }