Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into duty-time-metric
Browse files Browse the repository at this point in the history
  • Loading branch information
courtneyeh committed Oct 16, 2023
2 parents 49715e5 + eaf6e7c commit fb16ac0
Showing 1 changed file with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -596,14 +596,15 @@ private void changeToNone(ProtoNode parent) {
* Indicates if the node itself is viable for the head, or if it's best descendant is viable for
* the head.
*/
private boolean nodeLeadsToViableHead(ProtoNode node) {
boolean bestDescendantIsViableForHead =
node.getBestDescendantIndex()
.map(this::getNodeByIndex)
.map(this::nodeIsViableForHead)
.orElse(false);

return bestDescendantIsViableForHead || nodeIsViableForHead(node);
private boolean nodeLeadsToViableHead(final ProtoNode node) {
if (nodeIsViableForHead(node)) {
return true;
}

return node.getBestDescendantIndex()
.map(this::getNodeByIndex)
.map(this::nodeIsViableForHead)
.orElse(false);
}

/**
Expand Down

0 comments on commit fb16ac0

Please sign in to comment.