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/02/08 09:07:56 UTC

[GitHub] [pulsar] youzipi opened a new pull request #14165: [perf]: replace `ConcurrentSkipListMap.size()` with `isEmpty()`

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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] Shoothzj commented on pull request #14165: [perf]: replace `ConcurrentSkipListMap.size()` with `isEmpty()`

Posted by GitBox <gi...@apache.org>.
Shoothzj commented on pull request #14165:
URL: https://github.com/apache/pulsar/pull/14165#issuecomment-1032400892


   @youzipi the commit message is the PR template, do you mean the pr title? There is not a required style yet. Only required to add `[ISSUE XYZ]` when you are fixing issues.


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



[GitHub] [pulsar] codelipenghui merged pull request #14165: [perf]: replace `ConcurrentSkipListMap.size()` with `isEmpty()`

Posted by GitBox <gi...@apache.org>.
codelipenghui merged pull request #14165:
URL: https://github.com/apache/pulsar/pull/14165


   


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



[GitHub] [pulsar] youzipi commented on pull request #14165: [perf]: replace `ConcurrentSkipListMap.size()` with `isEmpty()`

Posted by GitBox <gi...@apache.org>.
youzipi commented on pull request #14165:
URL: https://github.com/apache/pulsar/pull/14165#issuecomment-1032397100


   @Shoothzj 
   is there a commit message guide for pulsar?
   
   I found different style messages in commit history,
   and i do not found any concept about this in https://pulsar.apache.org/en/contributing/
   
   


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