Bug 1248717 - Don't initialize variables in a for head with var, then use them later. r=jorendorff

This commit is contained in:
Morgan Phillips 2016-02-16 14:25:24 -06:00
parent ecefc94bfd
commit 9db5c6ce65

View File

@ -45,10 +45,10 @@ function CountingSort(array, len, signed) {
// For sorting small arrays.
function InsertionSort(array, from, to, comparefn) {
var item, swap;
for (var i = from + 1; i <= to; i++) {
let item, swap, i, j;
for (i = from + 1; i <= to; i++) {
item = array[i];
for (var j = i - 1; j >= from; j--) {
for (j = i - 1; j >= from; j--) {
swap = array[j];
if (comparefn(swap, item) <= 0)
break;