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
|
||||
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));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue