Skip to content

Commit

Permalink
handle tip nodes when counting connected internal nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
xji3 committed Oct 31, 2023
1 parent 61de19f commit 37064a5
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,12 @@ public int[] getConnectedParameterIndices(int index) {
nodeCount++;
}
int[] connectedIndices = new int[nodeCount];
int nodeIndex = 0;
for (int i = 0; i < treeModel.getChildCount(nodeRef); i++) {
NodeRef childNode = treeModel.getChild(nodeRef, i);
if (!treeModel.isExternal(childNode)) {
connectedIndices[i] = childNode.getNumber() - externalNodeCount;
connectedIndices[nodeIndex] = childNode.getNumber() - externalNodeCount;
nodeIndex++;
}
}
if (!treeModel.isRoot(nodeRef)) {
Expand Down

0 comments on commit 37064a5

Please sign in to comment.