gf2121 commented on code in PR #12699:
URL: https://github.com/apache/lucene/pull/12699#discussion_r1402119508


##########
lucene/core/src/java/org/apache/lucene/codecs/lucene90/blocktree/SegmentTermsEnum.java:
##########
@@ -1190,4 +1176,63 @@ public void seekExact(long ord) {
   public long ord() {
     throw new UnsupportedOperationException();
   }
+
+  static class OutputAccumulator extends DataInput {
+
+    BytesRef[] outputs = new BytesRef[16];
+    BytesRef current;
+    int num;
+    int outputIndex;
+    int index;
+
+    void push(BytesRef output) {
+      if (output != Lucene90BlockTreeTermsReader.NO_OUTPUT) {
+        outputs = ArrayUtil.grow(outputs, num + 1);
+        outputs[num++] = output;
+      }
+    }
+
+    void pop() {
+      this.num--;
+    }
+
+    void reset() {
+      this.num = 0;
+    }
+
+    void prepareRead() {
+      this.index = 0;
+      this.outputIndex = 0;
+      this.current = outputs[0];
+    }
+
+    void setFloorData(ByteArrayDataInput floorData) {
+      assert outputIndex == num - 1

Review Comment:
   I think the index can be non-zero here. The last arc could contains suffix 
of the MSBVLong output.



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