fix rbtree copy depth

This commit is contained in:
c9s 2021-05-23 00:17:12 +08:00
parent 5323b273bc
commit 0061e51dc9

View File

@ -130,10 +130,10 @@ func (b *RBTOrderBook) Copy() OrderBook {
return book
}
func (b *RBTOrderBook) CopyDepth(depth int) OrderBook {
func (b *RBTOrderBook) CopyDepth(limit int) OrderBook {
var book = NewRBOrderBook(b.Symbol)
book.Asks = b.Asks.CopyInorder(depth)
book.Bids = b.Bids.CopyInorder(depth)
book.Asks = b.Asks.CopyInorder(limit)
book.Bids = b.Bids.CopyInorderReverse(limit)
return book
}