performance improve.

This commit is contained in:
XenoAmess 2020-06-01 00:48:14 +08:00 committed by Rob Tompkins
parent 567388428c
commit 3ef823e8e1
1 changed files with 1 additions and 9 deletions

View File

@ -251,15 +251,7 @@ public class CharSequenceUtils {
* @return the resulting char array
*/
static char[] toCharArray(final CharSequence cs) {
if (cs instanceof String) {
return ((String) cs).toCharArray();
}
final int sz = cs.length();
final char[] array = new char[cs.length()];
for (int i = 0; i < sz; i++) {
array[i] = cs.charAt(i);
}
return array;
return cs.toString().toCharArray();
}
/**