Skip to content

Commit 5c7d64a

Browse files
committed
Fix code smell
1 parent 02158bf commit 5c7d64a

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

src/js/tabs/auxiliary.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ auxiliary.initialize = function (callback) {
5050
}
5151

5252
function isFlightMode(name) {
53-
for (let i = 0; i < flightModes.length; i++) {
54-
if (name == flightModes[i]) {
53+
for (let value of flightModes) {
54+
if (name == value) {
5555
return true;
5656
}
5757
}
@@ -468,7 +468,7 @@ auxiliary.initialize = function (callback) {
468468
}
469469
} else {
470470

471-
//ARM mode is a special case
471+
// ARM mode is a special case
472472
if (i == 0) {
473473
let armSwitchActive = false;
474474

@@ -549,12 +549,14 @@ auxiliary.initialize = function (callback) {
549549
return (x > y) ? x : y;
550550
}, 0);
551551

552-
//minimum change to autoselect is 100
553-
if (largest < 100) return fillPrevChannelsValues();
552+
// minimum change to autoselect is 100
553+
if (largest < 100) {
554+
return fillPrevChannelsValues();
555+
}
554556

555557
const indexOfMaxValue = diff_array.indexOf(largest);
556-
if (indexOfMaxValue >= 4 && indexOfMaxValue != RSSI_channel - 1){ //set channel
557-
auto_option.parent().val(indexOfMaxValue - 4);
558+
if (indexOfMaxValue >= 4 && indexOfMaxValue != RSSI_channel - 1) {
559+
auto_option.parent().val(indexOfMaxValue - 4); //set channel
558560
}
559561

560562
return fillPrevChannelsValues();

0 commit comments

Comments
 (0)