| 114 | |
| 115 | |
| 116 | void deleteTree() { |
| 117 | unsigned n = childCount(); |
| 118 | for (unsigned i = 0; i < n; ++i) { |
| 119 | auto child = _children[i].asMutable(); |
| 120 | if (child) { |
| 121 | if (child->isLeaf()) |
| 122 | delete (MutableLeaf*)child; |
| 123 | else |
| 124 | ((MutableInterior*)child)->deleteTree(); |
| 125 | } |
| 126 | } |
| 127 | delete this; |
| 128 | } |
| 129 | |
| 130 | |
| 131 | unsigned leafCount() const { |
no test coverage detected