NodeItem.isChildOf(): simplify if statements

Signed-off-by: Paul Campbell <pcampbell@kemitix.net>
This commit is contained in:
Paul Campbell 2016-03-14 15:41:23 +00:00
parent 79170b898a
commit d60f6ae0bb

View file

@ -108,13 +108,8 @@ public class NodeItem<T> implements Node<T> {
*/ */
@Override @Override
public boolean isChildOf(final Node<T> node) { public boolean isChildOf(final Node<T> node) {
if (node.equals(parent)) { return parent != null && (node.equals(parent) || parent.isChildOf(
return true; node));
}
if (parent != null) {
return parent.isChildOf(node);
}
return false;
} }
/** /**