| 129 | |
| 130 | |
| 131 | unsigned leafCount() const { |
| 132 | unsigned count = 0; |
| 133 | unsigned n = childCount(); |
| 134 | for (unsigned i = 0; i < n; ++i) { |
| 135 | auto child = _children[i]; |
| 136 | if (child.isMutable()) { |
| 137 | if (child.asMutable()->isLeaf()) |
| 138 | count += 1; |
| 139 | else |
| 140 | count += ((MutableInterior*)child.asMutable())->leafCount(); |
| 141 | } else { |
| 142 | if (child.asImmutable()->isLeaf()) |
| 143 | count += 1; |
| 144 | else |
| 145 | count += child.asImmutable()->interior.leafCount(); |
| 146 | } |
| 147 | } |
| 148 | return count; |
| 149 | } |
| 150 | |
| 151 | |
| 152 | NodeRef findNearest(hash_t hash) const { |
nothing calls this directly
no test coverage detected