mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-21 04:33:10 +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
|
||||
if ((gps1_updated && _gps_select_index == 0) || (gps2_updated && _gps_select_index == 1)) {
|
||||
_gps_new_output_data = true;
|
||||
|
||||
} else {
|
||||
_gps_new_output_data = false;
|
||||
}
|
||||
_gps_new_output_data = (gps1_updated && _gps_select_index == 0) ||
|
||||
(gps2_updated && _gps_select_index == 1);
|
||||
}
|
||||
|
||||
if (_gps_new_output_data) {
|
||||
|
||||
Reference in New Issue
Block a user