dungba88 commented on code in PR #12691:
URL: https://github.com/apache/lucene/pull/12691#discussion_r1365567273


##########
lucene/core/src/java/org/apache/lucene/util/fst/FST.java:
##########
@@ -552,14 +527,11 @@ public void save(DataOutput metaOut, DataOutput out) 
throws IOException {
     }
     metaOut.writeByte(t);
     metaOut.writeVLong(startNode);
-    if (bytes != null) {
-      long numBytes = bytes.getPosition();
-      metaOut.writeVLong(numBytes);
-      bytes.writeTo(out);
-    } else {
-      assert fstStore != null;
-      fstStore.writeTo(out);
+    // nocommit why does the FSTStore case does not need the numBytes?

Review Comment:
   Yeah, but it seems to be a rare case. User needs to use save a 
FSTStore-backed FST with a different DataOutput for metadata. I assume most 
people will use the same DataOutput for metadata and main FST body, which would 
not trigger the error.



-- 
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

Reply via email to