mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
binance: pre-allocate PriceVolumeSlice memory
This commit is contained in:
parent
2ec01e3d28
commit
f64b0e7a9f
|
@ -510,6 +510,8 @@ func parseDepthEvent(val *fastjson.Value) (*DepthEvent, error) {
|
|||
Symbol: string(val.GetStringBytes("s")),
|
||||
FirstUpdateID: val.GetInt64("U"),
|
||||
FinalUpdateID: val.GetInt64("u"),
|
||||
Bids: make(types.PriceVolumeSlice, 0, 50),
|
||||
Asks: make(types.PriceVolumeSlice, 0, 50),
|
||||
}
|
||||
|
||||
for _, ev := range val.GetArray("b") {
|
||||
|
|
Loading…
Reference in New Issue
Block a user