зеркало из https://github.com/mozilla/pjs.git
In NativeString.js_concat in the case of single argument call target.concat(arg) to avoid allocating StringBuffer instance.
This commit is contained in:
Родитель
15c7794f79
Коммит
d37001ed6e
|
@ -708,6 +708,10 @@ final class NativeString extends IdScriptable {
|
|||
private static String js_concat(String target, Object[] args) {
|
||||
int N = args.length;
|
||||
if (N == 0) { return target; }
|
||||
else if (N == 1) {
|
||||
String arg = ScriptRuntime.toString(args[0]);
|
||||
return target.concat(arg);
|
||||
}
|
||||
|
||||
// Find total capacity for the final string to avoid unnecessary
|
||||
// re-allocations in StringBuffer
|
||||
|
|
Загрузка…
Ссылка в новой задаче