mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-26 08:45:16 +00:00
binance: use fastjson parser pool
This commit is contained in:
parent
565cdef54f
commit
2ec01e3d28
|
@ -296,9 +296,11 @@ type ResultEvent struct {
|
||||||
ID int `json:"id"`
|
ID int `json:"id"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func parseWebSocketEvent(message []byte) (interface{}, error) {
|
var parserPool fastjson.ParserPool
|
||||||
val, err := fastjson.ParseBytes(message)
|
|
||||||
|
|
||||||
|
func parseWebSocketEvent(message []byte) (interface{}, error) {
|
||||||
|
parser := parserPool.Get()
|
||||||
|
val, err := parser.Parse(message)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user