jpountz commented on code in PR #12846:
URL: https://github.com/apache/lucene/pull/12846#discussion_r1444698183
##########
lucene/core/src/java/org/apache/lucene/codecs/lucene99/Lucene99SkipWriter.java:
##########
@@ -202,7 +202,11 @@ protected void writeSkipData(int level, DataOutput
skipBuffer) throws IOExceptio
CompetitiveImpactAccumulator competitiveFreqNorms =
curCompetitiveFreqNorms[level];
assert competitiveFreqNorms.getCompetitiveFreqNormPairs().size() > 0;
if (level + 1 < numberOfSkipLevels) {
- curCompetitiveFreqNorms[level + 1].addAll(competitiveFreqNorms);
+ if (curCompetitiveFreqNorms[level + 1].isEmpty()) {
+ curCompetitiveFreqNorms[level + 1].copy(competitiveFreqNorms);
+ } else {
+ curCompetitiveFreqNorms[level + 1].addAll(competitiveFreqNorms);
+ }
Review Comment:
This optimization doesn't look like it would kick in often, does it?
--
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]