mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-26 08:45:16 +00:00
rbt: check if returned node is neel
This commit is contained in:
parent
3b0ed4e3dc
commit
062443a29c
|
@ -355,6 +355,10 @@ func (tree *RBTree) RightmostOf(current *RBNode) *RBNode {
|
|||
current = current.Right
|
||||
}
|
||||
|
||||
if current == tree.neel {
|
||||
return nil
|
||||
}
|
||||
|
||||
return current
|
||||
}
|
||||
|
||||
|
@ -371,6 +375,10 @@ func (tree *RBTree) LeftmostOf(current *RBNode) *RBNode {
|
|||
current = current.Left
|
||||
}
|
||||
|
||||
if current == tree.neel {
|
||||
return nil
|
||||
}
|
||||
|
||||
return current
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user