gf2121 commented on code in PR #12738: URL: https://github.com/apache/lucene/pull/12738#discussion_r1378571480
########## lucene/core/src/java/org/apache/lucene/util/fst/NodeHash.java: ########## @@ -110,25 +110,34 @@ public long add(FSTCompiler.UnCompiledNode<T> nodeIn) throws IOException { node = getFallback(nodeIn, hash); if (node != 0) { // it was already in fallback -- promote to primary - primaryTable.set(pos, node); + primaryTable.set(pos, node, fallbackTable.getBytes(node)); } else { // not in fallback either -- freeze & add the incoming node // freeze & add - node = fstCompiler.addNode(nodeIn); + FSTCompiler<T>.NodeAndBuffer nodeAndBuffer = fstCompiler.addNode(nodeIn, true); Review Comment: Can we use logic like below to avoid changing `FSTCompile#addNode`? ``` long startAddress = fstCompiler.bytes.getPosition(); node = fstCompiler.addNode(nodeIn); byte[] bytes = null; if (node != FST.FINAL_END_NODE && node != FST.NON_FINAL_END_NODE) { bytes = new byte[Math.toIntExact(node - startAddress + 1)]; fstCompiler.bytes.copyBytes(startAddress, bytes, 0, bytes.length); } ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org