You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/11/20 03:37:51 UTC
[GitHub] [pulsar] 315157973 commented on a diff in pull request #18357: [improve][ml] Reduce object allocation when iterate on LongPairRangeSet
315157973 commented on code in PR #18357:
URL: https://github.com/apache/pulsar/pull/18357#discussion_r1027180751
##########
pulsar-common/src/main/java/org/apache/pulsar/common/util/collections/LongPairRangeSet.java:
##########
@@ -270,14 +305,27 @@ public void forEach(RangeProcessor<T> action) {
}
@Override
- public void forEach(RangeProcessor<T> action, LongPairConsumer<? extends T> consumer) {
+ public void forEach(RangeProcessor<T> action, LongPairConsumer<? extends T> outerConsumer) {
for (Range<T> range : asRanges()) {
if (!action.process(range)) {
break;
}
}
}
+ @Override
+ public void forEachRawRange(RawRangeProcessor action) {
+ for (Range<T> range : asRanges()) {
+ LongPair lowerEndpoint = this.rangeEndPointConsumer.apply(range.lowerEndpoint());
Review Comment:
When a range does not set the lower boundary, whether there will be NPE here?
--
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: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org