Commit 15eee47e authored by Matthew Halpern's avatar Matthew Halpern Committed by Péter Szilágyi

accounts: prefer nil slices over zero-length slices (#19079)

parent 34c85def
...@@ -137,8 +137,10 @@ func (ks *KeyStore) refreshWallets() { ...@@ -137,8 +137,10 @@ func (ks *KeyStore) refreshWallets() {
accs := ks.cache.accounts() accs := ks.cache.accounts()
// Transform the current list of wallets into the new one // Transform the current list of wallets into the new one
wallets := make([]accounts.Wallet, 0, len(accs)) var (
events := []accounts.WalletEvent{} wallets = make([]accounts.Wallet, 0, len(accs))
events []accounts.WalletEvent
)
for _, account := range accs { for _, account := range accs {
// Drop wallets while they were in front of the next account // Drop wallets while they were in front of the next account
......
...@@ -150,8 +150,10 @@ func (hub *Hub) refreshWallets() { ...@@ -150,8 +150,10 @@ func (hub *Hub) refreshWallets() {
// Transform the current list of wallets into the new one // Transform the current list of wallets into the new one
hub.stateLock.Lock() hub.stateLock.Lock()
wallets := make([]accounts.Wallet, 0, len(devices)) var (
events := []accounts.WalletEvent{} wallets = make([]accounts.Wallet, 0, len(devices))
events []accounts.WalletEvent
)
for _, device := range devices { for _, device := range devices {
url := accounts.URL{Scheme: hub.scheme, Path: device.Path} url := accounts.URL{Scheme: hub.scheme, Path: device.Path}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment