Skip to content

Commit

Permalink
fix #isChildOf implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
Revxrsal committed Oct 1, 2024
1 parent 9c36c11 commit 106b4fb
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,15 @@ && isSiblingOf(command)
}

@Override public boolean isChildOf(@NotNull ExecutableCommand<A> command) {
return path().startsWith(command.path());
if (size() <= command.size())
return false;
for (int i = 0; i < command.size(); i++) {
CommandNode<A> ourNode = nodes.get(i);
CommandNode<A> otherNode = command.nodes().get(i);
if (!otherNode.representation().equals(ourNode.representation()))
return false;
}
return true;
}

@Override public boolean containsFlags() {
Expand Down

0 comments on commit 106b4fb

Please sign in to comment.