You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@bookkeeper.apache.org by GitBox <gi...@apache.org> on 2021/06/24 22:12:58 UTC

[GitHub] [bookkeeper] mattisonchao opened a new pull request #2745: [Server] Refactor some code to improve performance.

mattisonchao opened a new pull request #2745:
URL: https://github.com/apache/bookkeeper/pull/2745


   ### Motivation
   
   Refactor some code to improve performance.
   
   ### Changes
   
   - Break the loop when the conditions are met.
   - Refactor string connection to SpringBuilder append.


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

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



[GitHub] [bookkeeper] mattisonchao closed pull request #2745: [Server] Refactor some code to improve performance.

Posted by GitBox <gi...@apache.org>.
mattisonchao closed pull request #2745:
URL: https://github.com/apache/bookkeeper/pull/2745


   


-- 
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: issues-unsubscribe@bookkeeper.apache.org

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



[GitHub] [bookkeeper] dlg99 commented on a change in pull request #2745: [Server] Refactor some code to improve performance.

Posted by GitBox <gi...@apache.org>.
dlg99 commented on a change in pull request #2745:
URL: https://github.com/apache/bookkeeper/pull/2745#discussion_r663171695



##########
File path: bookkeeper-server/src/main/java/org/apache/bookkeeper/tls/BookieAuthZFactory.java
##########
@@ -95,6 +95,7 @@ public void onProtocolUpgrade() {
                         for (String allowedRole : allowedRoles) {
                             if (certRole[0].equals(allowedRole)) {
                                 authorized = true;
+                                break;
                             }
                         }
                         if (authorized) {

Review comment:
       gosh, mentally misaligned closing `}`, makes sense.




-- 
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: issues-unsubscribe@bookkeeper.apache.org

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



[GitHub] [bookkeeper] mattisonchao commented on a change in pull request #2745: [Server] Refactor some code to improve performance.

Posted by GitBox <gi...@apache.org>.
mattisonchao commented on a change in pull request #2745:
URL: https://github.com/apache/bookkeeper/pull/2745#discussion_r662788132



##########
File path: bookkeeper-server/src/main/java/org/apache/bookkeeper/tls/BookieAuthZFactory.java
##########
@@ -95,6 +95,7 @@ public void onProtocolUpgrade() {
                         for (String allowedRole : allowedRoles) {
                             if (certRole[0].equals(allowedRole)) {
                                 authorized = true;
+                                break;
                             }
                         }
                         if (authorized) {

Review comment:
        When we first judge that `authorized` is true, we should break out of the loop to avoid the next useless loop. :)




-- 
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: issues-unsubscribe@bookkeeper.apache.org

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



[GitHub] [bookkeeper] dlg99 commented on a change in pull request #2745: [Server] Refactor some code to improve performance.

Posted by GitBox <gi...@apache.org>.
dlg99 commented on a change in pull request #2745:
URL: https://github.com/apache/bookkeeper/pull/2745#discussion_r662784605



##########
File path: bookkeeper-server/src/main/java/org/apache/bookkeeper/tls/BookieAuthZFactory.java
##########
@@ -95,6 +95,7 @@ public void onProtocolUpgrade() {
                         for (String allowedRole : allowedRoles) {
                             if (certRole[0].equals(allowedRole)) {
                                 authorized = true;
+                                break;
                             }
                         }
                         if (authorized) {

Review comment:
       why do you the `break` here?
   it bypasses the rest of the code that is executed depending on the value of `authorized`




-- 
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: issues-unsubscribe@bookkeeper.apache.org

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