From aca87ab6389f7cf6ab214688830528201c25ad2e Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Thu, 22 Feb 2018 17:46:28 +1100 Subject: [PATCH] AP_InertialSensor: remove pointless initialisations AP_InertialSensor: avoid pointless zeroing in constructor AP_InertialSensor is either in bss or is created via new (which zeroes memory) --- .../AP_InertialSensor/AP_InertialSensor.cpp | 38 +------------------ 1 file changed, 1 insertion(+), 37 deletions(-) diff --git a/libraries/AP_InertialSensor/AP_InertialSensor.cpp b/libraries/AP_InertialSensor/AP_InertialSensor.cpp index 3d7ab3df4d..1f3a87d68d 100644 --- a/libraries/AP_InertialSensor/AP_InertialSensor.cpp +++ b/libraries/AP_InertialSensor/AP_InertialSensor.cpp @@ -455,58 +455,22 @@ const AP_Param::GroupInfo AP_InertialSensor::var_info[] = { AP_InertialSensor *AP_InertialSensor::_s_instance = nullptr; AP_InertialSensor::AP_InertialSensor() : - _gyro_count(0), - _accel_count(0), - _backend_count(0), - _accel(), - _gyro(), _board_orientation(ROTATION_NONE), - _primary_gyro(0), - _primary_accel(0), - _log_raw_bit(-1), - _hil_mode(false), - _calibrating(false), - _backends_detected(false), - _accel_cal_requires_reboot(false), - _startup_error_counts_set(false), - _startup_ms(0) + _log_raw_bit(-1) { if (_s_instance) { AP_HAL::panic("Too many inertial sensors"); } _s_instance = this; AP_Param::setup_object_defaults(this, var_info); - for (uint8_t i=0; i