[poincare] Remove warning on unused variable

This commit is contained in:
Léa Saviot
2018-07-02 17:34:31 +02:00
parent 52a49f6bf7
commit d53abf5bf1
2 changed files with 8 additions and 3 deletions

View File

@@ -65,9 +65,11 @@ public:
int numberOfNodes() const {
int count = 0;
AllPool nodes = const_cast<TreePool *>(this)->allNodes();
for (TreeNode * t : nodes) {
TreeNode * firstNode = first();
TreeNode * lastNode = last();
while (firstNode != lastNode) {
count++;
firstNode = firstNode->next();
}
return count;
}

View File

@@ -93,8 +93,11 @@ TreeNode * TreeNode::editableRootTree() {
int TreeNode::numberOfDescendants(bool includeSelf) const {
int result = includeSelf ? 1 : 0;
for (TreeNode * child : depthFirstChildren()) {
TreeNode * nextSiblingNode = nextSibling();
TreeNode * currentNode = next();
while (currentNode != nextSiblingNode) {
result++;
currentNode = currentNode->next();
}
return result;
}