Return a node to the pool.
(nodeId int)
| 252 | |
| 253 | // Return a node to the pool. |
| 254 | func (tree *B2DynamicTree) FreeNode(nodeId int) { |
| 255 | B2Assert(0 <= nodeId && nodeId < tree.M_nodeCapacity) |
| 256 | B2Assert(0 < tree.M_nodeCount) |
| 257 | tree.M_nodes[nodeId].Next = tree.M_freeList |
| 258 | tree.M_nodes[nodeId].Height = -1 |
| 259 | tree.M_freeList = nodeId |
| 260 | tree.M_nodeCount-- |
| 261 | } |
| 262 | |
| 263 | // Create a proxy in the tree as a leaf node. We return the index |
| 264 | // of the node instead of a pointer so that we can grow |
no test coverage detected