()
| 553 | } |
| 554 | |
| 555 | func (n *SweepNode) Next() *SweepNode { |
| 556 | // go right |
| 557 | if n.right != nil { |
| 558 | n = n.right |
| 559 | for n.left != nil { |
| 560 | n = n.left // find the left-most of current subtree |
| 561 | } |
| 562 | return n |
| 563 | } |
| 564 | |
| 565 | for n.parent != nil && n.parent.right == n { |
| 566 | n = n.parent // find first parent for which we're left |
| 567 | } |
| 568 | return n.parent // can be nil |
| 569 | } |
| 570 | |
| 571 | //func (a *SweepNode) swap(b *SweepNode) { |
| 572 | // a.SweepPoint, b.SweepPoint = b.SweepPoint, a.SweepPoint |
no outgoing calls
no test coverage detected