Index: src/array.js |
=================================================================== |
--- src/array.js (revision 230) |
+++ src/array.js (working copy) |
@@ -111,6 +111,14 @@ |
return SparseJoin(array, length, convert); |
} |
+ // Fast case for one-element arrays. |
+ if (length === 1) { |
+ var e = array[0]; |
+ if (!IS_UNDEFINED(e) || (0 in array)) { |
+ return convert(e); |
+ } |
+ } |
+ |
var builder = new StringBuilder(); |
for (var i = 0; i < length; i++) { |