core/types: prealloce map

This commit is contained in:
cuiweixie 2025-10-28 01:44:08 +08:00
parent 33dbd64a23
commit 8d5c0894a5
No known key found for this signature in database
GPG key ID: 16DF64EE15E495A3

View file

@ -75,7 +75,7 @@ func (ga *GenesisAlloc) UnmarshalJSON(data []byte) error {
if err := json.Unmarshal(data, &m); err != nil {
return err
}
*ga = make(GenesisAlloc)
*ga = make(GenesisAlloc, len(m))
for addr, a := range m {
(*ga)[common.Address(addr)] = a
}