performance improve.
This commit is contained in:
parent
567388428c
commit
3ef823e8e1
|
@ -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();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue