refactor: use maps.Copy for cleaner map handling

Signed-off-by: xinhangzhou <shuangcui@aliyun.com>
This commit is contained in:
xinhangzhou
2025-03-24 17:13:47 +08:00
parent 5235f3b24f
commit b7e3c20383
7 changed files with 18 additions and 28 deletions

View File

@@ -2,6 +2,7 @@ package kvdb
import (
"fmt"
"maps"
"testing"
"github.com/btcsuite/btcwallet/walletdb"
@@ -77,9 +78,7 @@ func prefetchTest(t *testing.T, db walletdb.DB,
}, func() {})
require.NoError(t, err)
for k, v := range put {
items[k] = v
}
maps.Copy(items, put)
for _, k := range remove {
delete(items, k)