LuXugang commented on code in PR #792:
URL: https://github.com/apache/lucene/pull/792#discussion_r864438991


##########
lucene/core/src/java/org/apache/lucene/codecs/lucene91/Lucene91HnswVectorsReader.java:
##########
@@ -335,23 +344,23 @@ private static class FieldEntry {
       dimension = input.readInt();
       size = input.readInt();
 
-      int denseSparseMarker = input.readByte();
-      if (denseSparseMarker == -1) {
-        ordToDoc = null; // each document has a vector value
+      docsWithFieldOffset = input.readLong();
+      docsWithFieldLength = input.readLong();
+      jumpTableEntryCount = input.readShort();
+      denseRankPower = input.readByte();
+
+      // sparse
+      if (docsWithFieldOffset != -1 && docsWithFieldOffset != -2) {

Review Comment:
   Thanks  @jtibshirani ,In sparse case,  `docsWithFieldOffset` is always a 
value greater than 0, the clearer code could be write like:
   
   ```
         // dense or empty
         if (docsWithFieldOffset == -1 || docsWithFieldOffset == -2) {
           ...
         } else { // sparse
           ...
         }
   ```
        
   



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to