binance: fix parser parsebytes

This commit is contained in:
c9s 2022-01-07 15:30:04 +08:00 committed by c9s
parent eea4c43619
commit 24e465e5b6
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54

View File

@ -300,7 +300,7 @@ var parserPool fastjson.ParserPool
func parseWebSocketEvent(message []byte) (interface{}, error) {
parser := parserPool.Get()
val, err := parser.Parse(message)
val, err := parser.ParseBytes(message)
if err != nil {
return nil, err
}
@ -509,8 +509,8 @@ func parseDepthEvent(val *fastjson.Value) (depth *DepthEvent, err 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),
Bids: make(types.PriceVolumeSlice, 0, 50),
Asks: make(types.PriceVolumeSlice, 0, 50),
}
for _, ev := range val.GetArray("b") {