Skip to content

Commit 42dfbe3

Browse files
committed
Remove the unnecessary assertion
1 parent 06bc741 commit 42dfbe3

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

lucene/core/src/java/org/apache/lucene/util/fst/NodeHash.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,14 +134,12 @@ public long add(FSTCompiler.UnCompiledNode<T> nodeIn) throws IOException {
134134
// freeze & add
135135
node = fstCompiler.addNode(nodeIn);
136136

137+
// we use 0 as empty marker in hash table, so it better be impossible to get a frozen node
138+
// at 0:
137139
assert node != FST.FINAL_END_NODE && node != FST.NON_FINAL_END_NODE;
138140
byte[] buf = new byte[Math.toIntExact(node - startAddress + 1)];
139141
fstCompiler.bytes.copyBytes(startAddress, buf, 0, buf.length);
140142

141-
// we use 0 as empty marker in hash table, so it better be impossible to get a frozen node
142-
// at 0:
143-
assert node != 0;
144-
145143
primaryTable.set(pos, node, buf);
146144

147145
// confirm frozen hash and unfrozen hash are the same

0 commit comments

Comments
 (0)