jpountz commented on code in PR #13436: URL: https://github.com/apache/lucene/pull/13436#discussion_r1619417391
########## lucene/core/src/java/org/apache/lucene/index/SegmentDocValues.java: ########## @@ -76,10 +76,12 @@ synchronized DocValuesProducer getDocValuesProducer( /** Decrement the reference count of the given {@link DocValuesProducer} generations. */ synchronized void decRef(LongArrayList dvProducersGens) throws IOException { - for (LongCursor gen : dvProducersGens) { - RefCount<DocValuesProducer> dvp = genDVProducers.get(gen.value); - assert dvp != null : "gen=" + gen; - dvp.decRef(); - } + IOUtils.applyToAll( + dvProducersGens.stream().mapToObj(Long::valueOf).toList(), + gen -> { + RefCount<DocValuesProducer> dvp = genDVProducers.get(gen); + assert dvp != null : "gen=" + gen; + dvp.decRef(); + }); Review Comment: Agreed @benwtrent. I optimized for making the code look as similar as before without reverting the move to `LongArrayList`, in order to minimize room for bugs given the upcoming release. -- 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