Child returns the child of this node at the given index and returns nil if the index is out of range.
(i int)
| 199 | // Child returns the child of this node at the given index and returns nil if |
| 200 | // the index is out of range. |
| 201 | func (n *NodeBase) Child(i int) Node { |
| 202 | if i >= len(n.Children) || i < 0 { |
| 203 | return nil |
| 204 | } |
| 205 | return n.Children[i] |
| 206 | } |
| 207 | |
| 208 | // ChildByName returns the first child that has the given name, and nil |
| 209 | // if no such element is found. startIndex arg allows for optimized |
no outgoing calls