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
public boolean isChildOf(final Node<T> node) {
if (node.equals(parent)) {
return true;
}
if (parent != null) {
return parent.isChildOf(node);
}
return false;
return parent != null && (node.equals(parent) || parent.isChildOf(
node));
}
/**