Skip to content

Commit

Permalink
Preallocate slice but keep len==0
Browse files Browse the repository at this point in the history
  • Loading branch information
bznein committed Jun 27, 2024
1 parent 25239a2 commit 787d236
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/apps/transfer/keeper/relay.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ func (k Keeper) OnRecvPacket(ctx sdk.Context, packet channeltypes.Packet, data t
return err
}

receivedCoins := make(sdk.Coins, len(data.Tokens))
receivedCoins := make(sdk.Coins, 0, len(data.Tokens))
for _, token := range data.Tokens {
labels := []metrics.Label{
telemetry.NewLabel(coretypes.LabelSourcePort, packet.GetSourcePort()),
Expand Down

0 comments on commit 787d236

Please sign in to comment.