Skip to content

Commit 196fba8

Browse files
committed
game events: pre-initialize event data map with correct length
1 parent c061257 commit 196fba8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/demoinfocs/game_events.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -728,7 +728,7 @@ func getPlayerWeapon(player *common.Player, wepType common.EquipmentType) *commo
728728
}
729729

730730
func mapGameEventData(d *msg.CSVCMsg_GameEventListDescriptorT, e *msg.CSVCMsg_GameEvent) map[string]*msg.CSVCMsg_GameEventKeyT {
731-
data := make(map[string]*msg.CSVCMsg_GameEventKeyT)
731+
data := make(map[string]*msg.CSVCMsg_GameEventKeyT, len(d.Keys))
732732
for i, k := range d.Keys {
733733
data[k.Name] = e.Keys[i]
734734
}

0 commit comments

Comments
 (0)