diff --git a/core/genesis.go b/core/genesis.go index 738e68cb45..42836e0269 100644 --- a/core/genesis.go +++ b/core/genesis.go @@ -624,7 +624,7 @@ func decodePrealloc(data string) types.GenesisAlloc { acc.Nonce = account.Misc.Nonce acc.Code = account.Misc.Code - acc.Storage = make(map[common.Hash]common.Hash, len(account.Misc.Slots)) + acc.Storage = make(map[common.Hash]common.Hash) for _, slot := range account.Misc.Slots { acc.Storage[slot.Key] = slot.Val } diff --git a/node/rpcstack.go b/node/rpcstack.go index 4e85c5bb3b..6d3828ec2b 100644 --- a/node/rpcstack.go +++ b/node/rpcstack.go @@ -436,7 +436,7 @@ type virtualHostHandler struct { } func newVHostHandler(vhosts []string, next http.Handler) http.Handler { - vhostMap := make(map[string]struct{}, len(vhosts)) + vhostMap := make(map[string]struct{}) for _, allowedHost := range vhosts { vhostMap[strings.ToLower(allowedHost)] = struct{}{} } @@ -636,7 +636,7 @@ func RegisterApis(apis []rpc.API, modules []string, srv *rpc.Server) error { log.Error("Unavailable modules in HTTP API list", "unavailable", bad, "available", available) } // Generate the allow list based on the allowed modules - allowList := make(map[string]bool, len(modules)) + allowList := make(map[string]bool) for _, module := range modules { allowList[module] = true } diff --git a/rpc/server.go b/rpc/server.go index 47f15b1dd2..52866004f8 100644 --- a/rpc/server.go +++ b/rpc/server.go @@ -190,7 +190,7 @@ func (s *RPCService) Modules() map[string]string { s.server.services.mu.Lock() defer s.server.services.mu.Unlock() - modules := make(map[string]string, len(s.server.services.services)) + modules := make(map[string]string) for name := range s.server.services.services { modules[name] = "1.0" }