vsop-479 commented on code in PR #12846:
URL: https://github.com/apache/lucene/pull/12846#discussion_r1448225023
##########
lucene/core/src/java/org/apache/lucene/codecs/CompetitiveImpactAccumulator.java:
##########
@@ -93,6 +93,20 @@ public void addAll(CompetitiveImpactAccumulator acc) {
assert assertConsistent();
}
+ /** Copy {@code acc} into this empty acc. */
+ public void copy(CompetitiveImpactAccumulator acc) {
+ assert Arrays.stream(maxFreqs).sum() == 0;
+ assert otherFreqNormPairs.isEmpty();
Review Comment:
> why should the object currently be empty?
I think the caller should ensure current acc is empty when calling
``copy()``. If current acc is not empty, the caller should call
``CompetitiveImpactAccumulator.addAll()`` to merge them.
But you are right, it is the caller's responsibility to decide to call which
low level implementation. I will fix 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]