Skip to content

Commit

Permalink
event: initialize maps with known size (ethereum#27233)
Browse files Browse the repository at this point in the history
event: initialize maps with known size
  • Loading branch information
ucwong authored and shekhirin committed Jun 6, 2023
1 parent cc9d380 commit ab40fad
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion event/event.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func (mux *TypeMux) Subscribe(types ...interface{}) *TypeMuxSubscription {
close(sub.postC)
} else {
if mux.subm == nil {
mux.subm = make(map[reflect.Type][]*TypeMuxSubscription)
mux.subm = make(map[reflect.Type][]*TypeMuxSubscription, len(types))
}
for _, t := range types {
rtyp := reflect.TypeOf(t)
Expand Down

0 comments on commit ab40fad

Please sign in to comment.