Improve toString performance.
This commit is contained in:
parent
ca060e2c79
commit
23516c108a
1 changed files with 16 additions and 6 deletions
|
@ -709,6 +709,15 @@ public class StringList extends ArrayList<String> implements CharSequence
|
||||||
{
|
{
|
||||||
String result;
|
String result;
|
||||||
|
|
||||||
|
if (size() == 1)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
result = get(0);
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//
|
||||||
StringBuffer buffer = new StringBuffer(length());
|
StringBuffer buffer = new StringBuffer(length());
|
||||||
|
|
||||||
for (String string : this)
|
for (String string : this)
|
||||||
|
@ -717,6 +726,7 @@ public class StringList extends ArrayList<String> implements CharSequence
|
||||||
}
|
}
|
||||||
|
|
||||||
result = buffer.toString();
|
result = buffer.toString();
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
return (result);
|
return (result);
|
||||||
|
|
Loading…
Reference in a new issue