Skip to content

Commit

Permalink
Bug 408368 - Suboptimal code in array_sort implementation, code by Ig…
Browse files Browse the repository at this point in the history
…or Bukanov, r=crowder
  • Loading branch information
crowder committed Dec 14, 2007
1 parent 91cd74a commit f278891
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion js/src/jsarray.c
Original file line number Diff line number Diff line change
Expand Up @@ -1257,8 +1257,10 @@ array_sort(JSContext *cx, uintN argc, jsval *vp)
* to make it fast and unroot the cached results of toString
* invocations before the callback has a chance to run the GC.
*/
for (i = 0; i < newlen; i++)
i = 0;
do {
vec[i] = vec[2 * i + 1];
} while (++i != newlen);
}
} else {
void *mark;
Expand Down

0 comments on commit f278891

Please sign in to comment.