WJL3333 opened a new issue, #18356:
URL: https://github.com/apache/pulsar/issues/18356

   ### Search before asking
   
   - [X] I searched in the [issues](https://github.com/apache/pulsar/issues) 
and found nothing similar.
   
   
   ### Motivation
   
   according to #18240 
   
   when iterate on `LongPairRangeSet` call `forEach` will:
   1. convert long pair into `Range` object.
   2. and then the `Range` object is passed to `LongPairConsumer<? extends T> 
consumer` which is `PostitionImpl::new`.
   
   but for the case `ManagedCursorImpl.buildIndividualDeletedMessageRanges` and 
`ConcurrentOpenLongPairRangeSet.size`
   we can get the answer by just perform on the raw (long, long) format. the 
object creation can be avoided.
   
   ### Solution
   
   _No response_
   
   ### Alternatives
   
   _No response_
   
   ### Anything else?
   
   _No response_
   
   ### Are you willing to submit a PR?
   
   - [X] I'm willing to submit a PR!


-- 
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]

Reply via email to