remove removes a node from the stack. It is a no-op if n is not present.
(n *Node)
| 203 | |
| 204 | // remove removes a node from the stack. It is a no-op if n is not present. |
| 205 | func (s *nodeStack) remove(n *Node) { |
| 206 | i := s.index(n) |
| 207 | if i == -1 { |
| 208 | return |
| 209 | } |
| 210 | copy((*s)[i:], (*s)[i+1:]) |
| 211 | j := len(*s) - 1 |
| 212 | (*s)[j] = nil |
| 213 | *s = (*s)[:j] |
| 214 | } |
| 215 | |
| 216 | type insertionModeStack []insertionMode |
| 217 |
no test coverage detected