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