mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1248717 - Don't initialize variables in a for head with var, then use them later. r=jorendorff
This commit is contained in:
parent
ecefc94bfd
commit
9db5c6ce65
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user