eval implements the EVAL part of the LT algorithm.
(v *node)
| 98 | |
| 99 | // eval implements the EVAL part of the LT algorithm. |
| 100 | func (lt *ltState) eval(v *node) *node { |
| 101 | u := v |
| 102 | for ; lt.ancestor[v.dom.index] != nil; v = lt.ancestor[v.dom.index] { |
| 103 | if lt.sdom[v.dom.index].dom.pre < lt.sdom[u.dom.index].dom.pre { |
| 104 | u = v |
| 105 | } |
| 106 | } |
| 107 | return u |
| 108 | } |
| 109 | |
| 110 | // link implements the LINK part of the LT algorithm. |
| 111 | func (lt *ltState) link(v, w *node) { |