This is an automated email from the ASF dual-hosted git repository.

zhouky pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-celeborn.git


The following commit(s) were added to refs/heads/main by this push:
     new efc36ebdb [CELEBORN-1043] Convert variable ‘metric’ from String to 
StringBuilder in toMetric method
efc36ebdb is described below

commit efc36ebdba0b5e2245e9257e02229b9dcddb2dfd
Author: jiaoqingbo <[email protected]>
AuthorDate: Tue Oct 17 16:51:29 2023 +0800

    [CELEBORN-1043] Convert variable ‘metric’ from String to StringBuilder in 
toMetric method
    
    ### What changes were proposed in this pull request?
    
    As Title
    
    ### Why are the changes needed?
    
    As Title
    
    ### Does this PR introduce _any_ user-facing change?
    
    NO
    
    ### How was this patch tested?
    
    PASS GA
    
    Closes #1996 from jiaoqingbo/1043.
    
    Authored-by: jiaoqingbo <[email protected]>
    Signed-off-by: zky.zhoukeyong <[email protected]>
---
 .../src/main/java/org/apache/celeborn/common/meta/DiskStatus.java | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git 
a/common/src/main/java/org/apache/celeborn/common/meta/DiskStatus.java 
b/common/src/main/java/org/apache/celeborn/common/meta/DiskStatus.java
index edf313271..6180f64f3 100644
--- a/common/src/main/java/org/apache/celeborn/common/meta/DiskStatus.java
+++ b/common/src/main/java/org/apache/celeborn/common/meta/DiskStatus.java
@@ -37,14 +37,14 @@ public enum DiskStatus {
 
   public final String toMetric() {
     String[] fragments = this.name().split("_");
-    String metric = "";
+    StringBuilder metric = new StringBuilder();
     for (String fragment : fragments) {
       int len = fragment.length();
       if (len >= 1) {
-        metric += fragment.substring(0, 1).toUpperCase();
-        metric += fragment.substring(1, len).toLowerCase();
+        metric.append(fragment.substring(0, 1).toUpperCase());
+        metric.append(fragment.substring(1, len).toLowerCase());
       }
     }
-    return metric;
+    return metric.toString();
   }
 }

Reply via email to