DeleteChild deletes the given child node, returning false if it can not find it.
(child Node)
| 348 | // DeleteChild deletes the given child node, returning false if |
| 349 | // it can not find it. |
| 350 | func (n *NodeBase) DeleteChild(child Node) bool { |
| 351 | if child == nil { |
| 352 | return false |
| 353 | } |
| 354 | idx := IndexOf(n.Children, child) |
| 355 | if idx < 0 { |
| 356 | return false |
| 357 | } |
| 358 | return n.DeleteChildAt(idx) |
| 359 | } |
| 360 | |
| 361 | // DeleteChildByName deletes child node by name, returning false |
| 362 | // if it can not find it. |