youzipi opened a new pull request #14165:
URL: https://github.com/apache/pulsar/pull/14165


   
   
   ### Motivation
   
   
[java_doc](https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ConcurrentSkipListMap.html#:~:text=Beware%20that%2C%20unlike%20in%20most%20collections%2C%20the%20size%20method%20is%20not%20a%20constant%2Dtime%20operation.)
   `ConcurrentSkipListMap.size()` is not a constant-time operation, it is 
unnessary to calculate the size when we just want to check if collection is 
empty.
   
   generally, we should always use `isEmpty` instead of `size` in `checkEmpty` 
case as it is more clear.
   
   
   
   ### Modifications
   
   replace `ConcurrentSkipListMap.size()` with `isEmpty()` when check if 
collection is empty.
   
   
   ### Verifying this change
   
   - [ ] Make sure that the change passes the CI checks.
   
   *(Please pick either of the following options)*
   
   This change is a trivial rework / code cleanup without any test coverage.
   
   *(or)*
   
   This change is already covered by existing tests, such as *(please describe 
tests)*.
   
   *(or)*
   
   This change added tests and can be verified as follows:
   
   *(example:)*
     - *Added integration tests for end-to-end deployment with large payloads 
(10MB)*
     - *Extended integration test for recovery after broker failure*
   
   
   
   ### Documentation
   
   Check the box below or label this PR directly (if you have committer 
privilege).
   
   Need to update docs? 
   
   - [ ] `doc-required` 
     
     (If you need help on updating docs, create a doc issue)
     
   - [x] `no-need-doc` 
     
   it is an internal improvement, no action is changed.
     
   - [ ] `doc` 
     
     (If this PR contains doc changes)
   
   
   


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