NodeItem::insertInPath: clarify local variable name

This commit is contained in:
Paul Campbell 2016-09-20 22:24:28 +01:00
parent f9aba88d0c
commit 753b37cc1d

View file

@ -264,9 +264,9 @@ class NodeItem<T> implements Node<T> {
if (path.length == 0) { if (path.length == 0) {
insertChild(nodeItem); insertChild(nodeItem);
} else { } else {
val item = path[0]; val nextInPath = path[0];
findChildByName(item).orElseGet(() -> new NodeItem<>(null, item, this)) findChildByName(nextInPath).orElseGet(() -> new NodeItem<>(null, nextInPath, this, new HashSet<>()))
.insertInPath(nodeItem, Arrays.copyOfRange(path, 1, path.length)); .insertInPath(nodeItem, Arrays.copyOfRange(path, 1, path.length));
} }
} }