mikemccand commented on code in PR #12981: URL: https://github.com/apache/lucene/pull/12981#discussion_r1447388445
########## lucene/core/src/java/org/apache/lucene/util/fst/FSTCompiler.java: ########## @@ -552,13 +550,22 @@ long addNode(FSTCompiler.UnCompiledNode<T> nodeIn) throws IOException { } reverseScratchBytes(); + // write the padding byte if needed + if (numBytesWritten == 1) { + writePaddingByte(); + } scratchBytes.writeTo(dataOutput); numBytesWritten += scratchBytes.getPosition(); nodeCount++; return numBytesWritten - 1; } + private void writePaddingByte() throws IOException { + assert numBytesWritten == 1; Review Comment: Maybe add a comment explaining what this padding byte even is for? I myself cannot remember :) -- 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