From acdcdc35fa8986290ec34bb0b85d66a9fc409c39 Mon Sep 17 00:00:00 2001 From: Lucas De Marchi Date: Sun, 24 May 2015 07:40:10 -0300 Subject: [PATCH] AP_HAL_SITL: Do not compare delegate to NULL Use the simpler "if (delegate_name)" since it allows simpler implementation in the class, i.e. the bool operator rather than having to compare to another object. --- libraries/AP_HAL_SITL/Scheduler.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/AP_HAL_SITL/Scheduler.cpp b/libraries/AP_HAL_SITL/Scheduler.cpp index a75143aa44..b346c52ad6 100644 --- a/libraries/AP_HAL_SITL/Scheduler.cpp +++ b/libraries/AP_HAL_SITL/Scheduler.cpp @@ -221,7 +221,7 @@ void SITLScheduler::_run_timer_procs(bool called_from_isr) if (!_timer_suspended) { // now call the timer based drivers for (int i = 0; i < _num_timer_procs; i++) { - if (_timer_proc[i] != NULL) { + if (_timer_proc[i]) { _timer_proc[i](); } } @@ -247,7 +247,7 @@ void SITLScheduler::_run_io_procs(bool called_from_isr) if (!_timer_suspended) { // now call the IO based drivers for (int i = 0; i < _num_io_procs; i++) { - if (_io_proc[i] != NULL) { + if (_io_proc[i]) { _io_proc[i](); } }