mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-14 02:53:50 +00:00
types: rbtree - add panic check
This commit is contained in:
parent
4e4ffe83e5
commit
2dff1e72da
|
@ -314,6 +314,9 @@ func (tree *RBTree) RotateRight(y *RBNode) {
|
||||||
y.left = x.right
|
y.left = x.right
|
||||||
|
|
||||||
if !x.right.isNil() {
|
if !x.right.isNil() {
|
||||||
|
if x.right == nil {
|
||||||
|
panic(fmt.Errorf("x.right is nil: node = %+v, left = %+v, right = %+v, parent = %+v", x, x.left, x.right, x.parent))
|
||||||
|
}
|
||||||
x.right.parent = y
|
x.right.parent = y
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user