From 5faadf4cd1b40717dd0bb902b4b154b0454f5351 Mon Sep 17 00:00:00 2001 From: DrZiplok Date: Tue, 28 Dec 2010 23:32:37 +0000 Subject: [PATCH] use memset rather than explicit assignments to zero to zero an array, this saves code space. git-svn-id: https://arducopter.googlecode.com/svn/trunk@1340 f9c3cf11-9bcb-44bc-f272-b75c42450872 --- libraries/AP_Compass/AP_Compass_HIL.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libraries/AP_Compass/AP_Compass_HIL.cpp b/libraries/AP_Compass/AP_Compass_HIL.cpp index 48746c142f..66409a2afa 100644 --- a/libraries/AP_Compass/AP_Compass_HIL.cpp +++ b/libraries/AP_Compass/AP_Compass_HIL.cpp @@ -15,9 +15,7 @@ AP_Compass_HIL::AP_Compass_HIL() : orientation(0), declination(0.0) { // mag x y z offset initialisation - offset[0] = 0; - offset[1] = 0; - offset[2] = 0; + memset(offset, 0, sizeof(offset)); // initialise orientation matrix orientation_matrix = ROTATION_NONE;