summaryrefslogtreecommitdiff
path: root/src/main/java/cuchaz/enigma
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/cuchaz/enigma')
-rw-r--r--src/main/java/cuchaz/enigma/translation/mapping/tree/HashEntryTree.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/main/java/cuchaz/enigma/translation/mapping/tree/HashEntryTree.java b/src/main/java/cuchaz/enigma/translation/mapping/tree/HashEntryTree.java
index fa9ed13..c5fc473 100644
--- a/src/main/java/cuchaz/enigma/translation/mapping/tree/HashEntryTree.java
+++ b/src/main/java/cuchaz/enigma/translation/mapping/tree/HashEntryTree.java
@@ -115,16 +115,19 @@ public class HashEntryTree<T> implements EntryTree<T> {
115 115
116 Entry<?> rootEntry = ancestry.get(0); 116 Entry<?> rootEntry = ancestry.get(0);
117 HashTreeNode<T> node = make ? root.computeIfAbsent(rootEntry, HashTreeNode::new) : root.get(rootEntry); 117 HashTreeNode<T> node = make ? root.computeIfAbsent(rootEntry, HashTreeNode::new) : root.get(rootEntry);
118 if (node == null) {
119 return Collections.emptyList();
120 }
121
118 path.add(node); 122 path.add(node);
119 123
120 for (int i = 1; i < ancestry.size(); i++) { 124 for (int i = 1; i < ancestry.size(); i++) {
125 Entry<?> ancestor = ancestry.get(i);
126 node = make ? node.computeChild(ancestor) : node.getChild(ancestor);
121 if (node == null) { 127 if (node == null) {
122 return Collections.emptyList(); 128 return Collections.emptyList();
123 } 129 }
124 130
125 Entry<?> ancestor = ancestry.get(i);
126 node = make ? node.computeChild(ancestor) : node.getChild(ancestor);
127
128 path.add(node); 131 path.add(node);
129 } 132 }
130 133