Skip to content

Commit

Permalink
Change manual to stop leaves from auto-sorting below categories
Browse files Browse the repository at this point in the history
  • Loading branch information
BluSunrize committed Apr 20, 2024
1 parent 595410a commit 56ba68b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/manual/java/blusunrize/lib/manual/Tree.java
Expand Up @@ -111,8 +111,7 @@ public static class InnerNode<NT extends Comparable<NT>, LT extends Comparable<L
private final List<AbstractNode<NT, LT>> children = new ArrayList<>();

private final Comparator<AbstractNode<NT, LT>> compare =
Comparator.<AbstractNode<NT, LT>, Boolean>comparing(AbstractNode::isLeaf)
.thenComparingDouble(AbstractNode::getWeight)
Comparator.<AbstractNode<NT, LT>>comparingDouble(AbstractNode::getWeight)
//Nulls should be irrelevant (either both or neither are null)
.thenComparing(AbstractNode::getNodeData, Comparator.nullsFirst(Comparator.naturalOrder()))
.thenComparing(AbstractNode::getLeafData, Comparator.nullsFirst(Comparator.naturalOrder()));
Expand Down

0 comments on commit 56ba68b

Please sign in to comment.