http://codereview.chromium.org/6100005/diff/2001/src/array.js File src/array.js (right):
http://codereview.chromium.org/6100005/diff/2001/src/array.js#newcode148 src/array.js:148: if (!IS_UNDEFINED(e) || (i in array)) { On 2011/01/07 14:58:58, Lasse Reichstein wrote:
If all actually used convert functions convert undefined to the empty
string,
feel free to omit the (i in array) test, and document that convert
isn't called
on undefined either.
Done. http://codereview.chromium.org/6100005/diff/2001/src/array.js#newcode152 src/array.js:152: elements[i] = ''; On 2011/01/07 14:58:58, Lasse Reichstein wrote:
Would it be slower to have a separate counter for inserts, and not
insert empty
strings at all? (And remember to set the length at the end).
You need to know where the separator goes, hence a single counter wouldn't suffice. http://codereview.chromium.org/6100005/diff/2001/src/array.js#newcode164 src/array.js:164: } On 2011/01/07 14:58:58, Lasse Reichstein wrote:
If you run backwards, you could expand the array in-place, and not
allocate a
second array. If the array had twice the size from the start, you wouldn't even need
to expand
it - but you would waste some memory in some cases.
Done. http://codereview.chromium.org/6100005/ -- v8-dev mailing list [email protected] http://groups.google.com/group/v8-dev
