зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1248717 - Don't initialize variables in a for head with var, then use them later. r=jorendorff
--HG-- extra : rebase_source : 4de90a39708b79fe122fe0adc73a76744505bbea
This commit is contained in:
Родитель
58592042ef
Коммит
73778dd365
|
@ -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;
|
||||
|
|
Загрузка…
Ссылка в новой задаче