chore: Clean up variable assignment. (#7962)

* chore: Clean up variable assignment.

* fix: variable now const as a result of prev commit
This commit is contained in:
Neil Fraser
2024-03-26 19:13:52 +01:00
committed by GitHub
parent 2f4bea4ede
commit 2ea9e21e6d
12 changed files with 16 additions and 18 deletions

View File

@@ -513,7 +513,7 @@ function mathModes(values) {
}
for (var j = 0; j < counts.length; j++) {
if (counts[j][1] === maxCount) {
modes.push(counts[j][0]);
modes.push(counts[j][0]);
}
}
return modes;
@@ -527,7 +527,7 @@ function mathStandardDeviation(numbers) {
for (var j = 0; j < n; j++) {
variance += Math.pow(numbers[j] - mean, 2);
}
variance = variance / n;
variance /= n;
return Math.sqrt(variance);
}

View File

@@ -154,7 +154,7 @@ dartGenerator.forBlock['unittest_adjustindex'] = function(block) {
return [Number(index) + 1, dartGenerator.ORDER_ATOMIC];
} else {
// If the index is dynamic, adjust it in code.
index = index + ' + 1';
index += ' + 1';
}
} else if (Blockly.utils.string.isNumber(index)) {
return [index, dartGenerator.ORDER_ATOMIC];

View File

@@ -158,7 +158,7 @@ javascriptGenerator.forBlock['unittest_adjustindex'] = function(block) {
return [Number(index) + 1, javascriptGenerator.ORDER_ATOMIC];
} else {
// If the index is dynamic, adjust it in code.
index = index + ' + 1';
index += ' + 1';
}
} else if (Blockly.utils.string.isNumber(index)) {
return [index, javascriptGenerator.ORDER_ATOMIC];

View File

@@ -145,7 +145,7 @@ phpGenerator.forBlock['unittest_adjustindex'] = function(block) {
return [Number(index) + 1, phpGenerator.ORDER_ATOMIC];
} else {
// If the index is dynamic, adjust it in code.
index = index + ' + 1';
index += ' + 1';
}
} else if (Blockly.utils.string.isNumber(index)) {
return [index, phpGenerator.ORDER_ATOMIC];

View File

@@ -129,7 +129,7 @@ pythonGenerator.forBlock['unittest_adjustindex'] = function(block) {
return [Number(index) + 1, pythonGenerator.ORDER_ATOMIC];
} else {
// If the index is dynamic, adjust it in code.
index = index + ' + 1';
index += ' + 1';
}
} else if (Blockly.utils.string.isNumber(index)) {
return [index, pythonGenerator.ORDER_ATOMIC];