refactor: use maps.Copy for cleaner map handling
Signed-off-by: xinhangzhou <shuangcui@aliyun.com>
This commit is contained in:
1 parent
5235f3b24f
commit
b7e3c20383
7 files changed
+18
-28
No files matched your search
+2
-3
@@ -2,6 +2,7 @@ package lnd
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"maps"
|
||||
"sync"
|
||||
|
||||
"github.com/btcsuite/btcd/btcec/v2"
|
||||
@@ -66,9 +67,7 @@ func newAccessMan(cfg *accessManConfig) (*accessMan, error) {
|
||||
// We'll populate the server's peerCounts map with the counts fetched
|
||||
// via initAccessPerms. Also note that we haven't yet connected to the
|
||||
// peers.
|
||||
for peerPub, count := range counts {
|
||||
a.peerCounts[peerPub] = count
|
||||
}
|
||||
maps.Copy(a.peerCounts, counts)
|
||||
|
||||
return a, nil
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user