Skip to content

Commit

Permalink
I feel dirty
Browse files Browse the repository at this point in the history
  • Loading branch information
VolkerGoeschl committed Apr 1, 2023
1 parent 2e6a246 commit 13d850f
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions js/flightlog_index.js
Original file line number Diff line number Diff line change
Expand Up @@ -286,20 +286,14 @@ function FlightLogIndex(logData) {
}

if (sourceIndex.avgThrottle.length > 0) {
// Assuming that avgThrottle, maxRC and maxMotorDiff Arrays are the same length
// since they are build in the same loop. Just to get rid of a codesmell on Sonarcloud
for (let j = 0; j < sourceIndex.avgThrottle.length; j++) {
resultIndex.avgThrottle[j] = sourceIndex.avgThrottle[j] - 1000;
}
}
if (sourceIndex.maxRC.length > 0) {
for (let j = 0; j < sourceIndex.maxRC.length; j++) {
resultIndex.maxRC[j] = sourceIndex.maxRC[j] * 20 - 1000;
}
}
if (sourceIndex.maxMotorDiff.length > 0) {
for (let j = 0; j < sourceIndex.maxMotorDiff.length; j++) {
resultIndex.maxMotorDiff[j] = sourceIndex.maxMotorDiff[j] * 20 - 1000;
}
}
}
resultIndexes[i] = resultIndex;
}

Expand Down

0 comments on commit 13d850f

Please sign in to comment.