performance improve.
This commit is contained in:
parent
567388428c
commit
3ef823e8e1
|
@ -251,15 +251,7 @@ public class CharSequenceUtils {
|
||||||
* @return the resulting char array
|
* @return the resulting char array
|
||||||
*/
|
*/
|
||||||
static char[] toCharArray(final CharSequence cs) {
|
static char[] toCharArray(final CharSequence cs) {
|
||||||
if (cs instanceof String) {
|
return cs.toString().toCharArray();
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue