NodeItem.isChildOf(): simplify if statements
Signed-off-by: Paul Campbell <pcampbell@kemitix.net>
This commit is contained in:
parent
79170b898a
commit
d60f6ae0bb
1 changed files with 2 additions and 7 deletions
|
@ -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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue