mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-07 03:51:36 +08:00
ekf2_main: simplify "if true else false" with direct boolean assignment
This commit is contained in:
committed by
Mathieu Bresciani
parent
f6a72663fa
commit
20705e3c53
@@ -977,12 +977,8 @@ void Ekf2::Run()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Only use selected receiver data if it has been updated
|
// Only use selected receiver data if it has been updated
|
||||||
if ((gps1_updated && _gps_select_index == 0) || (gps2_updated && _gps_select_index == 1)) {
|
_gps_new_output_data = (gps1_updated && _gps_select_index == 0) ||
|
||||||
_gps_new_output_data = true;
|
(gps2_updated && _gps_select_index == 1);
|
||||||
|
|
||||||
} else {
|
|
||||||
_gps_new_output_data = false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_gps_new_output_data) {
|
if (_gps_new_output_data) {
|
||||||
|
|||||||
Reference in New Issue
Block a user