From d60f6ae0bbca06e12848eed7225d89684b515fc3 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Mon, 14 Mar 2016 15:41:23 +0000 Subject: [PATCH] NodeItem.isChildOf(): simplify if statements Signed-off-by: Paul Campbell --- src/main/java/net/kemitix/node/NodeItem.java | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/main/java/net/kemitix/node/NodeItem.java b/src/main/java/net/kemitix/node/NodeItem.java index 13efcb5..5321674 100644 --- a/src/main/java/net/kemitix/node/NodeItem.java +++ b/src/main/java/net/kemitix/node/NodeItem.java @@ -108,13 +108,8 @@ public class NodeItem implements Node { */ @Override public boolean isChildOf(final Node 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)); } /**