[GitHub] [commons-lang] YuyuZha0 commented on a change in pull request #443: Optimize string split methods: 1. Use ThreadLocal to make reuse of th…

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[GitHub] [commons-lang] YuyuZha0 commented on a change in pull request #443: Optimize string split methods: 1. Use ThreadLocal to make reuse of th…

GitBox
YuyuZha0 commented on a change in pull request #443: Optimize string split methods: 1. Use ThreadLocal to make reuse of th…
URL: https://github.com/apache/commons-lang/pull/443#discussion_r317380867
 
 

 ##########
 File path: src/main/java/org/apache/commons/lang3/StringUtils.java
 ##########
 @@ -7434,7 +7434,7 @@ public static String rotate(final String str, final int shift) {
             return ArrayUtils.EMPTY_STRING_ARRAY;
         }
         final char[] c = str.toCharArray();
-        final List<String> list = new ArrayList<>();
+        final SplitBuffer buffer = SPLIT_BUFFER_THREAD_LOCAL.get().getBuffer();
 
 Review comment:
   The SplitBuffer instance is not a List instance anymore, leave it with a name "list" would be misleading I think.

----------------------------------------------------------------
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:
[hidden email]


With regards,
Apache Git Services