Skip to content

Commit 106b4fb

Browse files
committed
fix #isChildOf implementation
1 parent 9c36c11 commit 106b4fb

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

common/src/main/java/revxrsal/commands/node/parser/Execution.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,15 @@ && isSiblingOf(command)
243243
}
244244

245245
@Override public boolean isChildOf(@NotNull ExecutableCommand<A> command) {
246-
return path().startsWith(command.path());
246+
if (size() <= command.size())
247+
return false;
248+
for (int i = 0; i < command.size(); i++) {
249+
CommandNode<A> ourNode = nodes.get(i);
250+
CommandNode<A> otherNode = command.nodes().get(i);
251+
if (!otherNode.representation().equals(ourNode.representation()))
252+
return false;
253+
}
254+
return true;
247255
}
248256

249257
@Override public boolean containsFlags() {

0 commit comments

Comments
 (0)