vsop-479 commented on code in PR #12846: URL: https://github.com/apache/lucene/pull/12846#discussion_r1447008409
########## 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: @jpountz Should we remove this optimization to make code more clearer? -- 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