vsop-479 commented on code in PR #16245:
URL: https://github.com/apache/lucene/pull/16245#discussion_r3550529579
##########
lucene/core/src/java/org/apache/lucene/codecs/lucene103/blocktree/SegmentTermsEnumFrame.java:
##########
@@ -690,7 +715,9 @@ public SeekStatus binarySearchTermLeaf(BytesRef target,
boolean exactOnly) throw
assert prefixMatches(target);
- suffixLength = suffixLengthsReader.readVInt();
+ // suffixLength assigned in loadBlock, and all suffixes have the same
length in this block.
+ assert suffixLength >= 0;
Review Comment:
I reseted `suffixLength` to -1 for non-allEqual block in
`SegmentTermsEnumFrame`.
But we can't reset `suffixLength` to -1 in `IntersectTermsEnumFrame`, since
`IntersectTermsEnum#seekToStartTerm` uses saveSuffix as length to arraycopy
when cmp > 0. When target is "", the length is 0 is ok. if reset suffixLength
to -1, the length will be -1.
I am wondering whether `SegmentTermsEnumFrame` and `IntersectTermsEnumFrame`
need to behave consistently here -- either neither resets `suffixLength` to -1,
or both reset it to 0.
--
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]