You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by GitBox <gi...@apache.org> on 2020/06/14 03:39:04 UTC

[GitHub] [incubator-dolphinscheduler] CalvinKirs commented on a change in pull request #2920: Simplify some methods for easy understanding

CalvinKirs commented on a change in pull request #2920:
URL: https://github.com/apache/incubator-dolphinscheduler/pull/2920#discussion_r439788408



##########
File path: dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/IpUtils.java
##########
@@ -49,12 +49,11 @@ public static String longToIp(long ipLong) {
     ipNumbers[2] = ipLong >> 8 & tmp;
     ipNumbers[3] = ipLong & tmp;
 
-    StringBuilder sb = new StringBuilder(16);
-    sb.append(ipNumbers[0]).append(DOT)
-            .append(ipNumbers[1]).append(DOT)
-            .append(ipNumbers[2]).append(DOT)
-            .append(ipNumbers[3]);
-    return sb.toString();
+    String sb = ipNumbers[0] + DOT +

Review comment:
       > why not StringBuilder?
   
   The functions of the two are the same, but String+ looks more concise, and from a performance perspective, String is better




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