rmuir commented on a change in pull request #1281: LUCENE-9245: Optimize
AutomatonTermsEnum memory and automaton Operations.getCommonPrefixBytesRef.
URL: https://github.com/apache/lucene-solr/pull/1281#discussion_r383282576
##########
File path: lucene/core/src/java/org/apache/lucene/index/AutomatonTermsEnum.java
##########
@@ -188,7 +188,11 @@ private boolean nextString() {
savedStates.setIntAt(0, 0);
while (true) {
- curGen++;
+ if (++curGen == 0) {
+ // Clear the visited states every time curGen overflows (so very
infrequently to not impact average perf).
+ curGen++;
Review comment:
Can we remove this unnecessary increment. Also i'd change the comment from
`overflows` to `wraps`.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]