diff options
author | Julian Oes <julian@oes.ch> | 2014-04-07 21:42:48 +0200 |
---|---|---|
committer | Julian Oes <julian@oes.ch> | 2014-04-07 21:42:48 +0200 |
commit | bb3792bcdd8edeb24cad7ef0170c76a552f943d5 (patch) | |
tree | 95dab0fcb5ab24c8777aa5e573f52c1288f1ebf9 /src/modules | |
parent | a4a12dab337f132bfe51db2ad482273ecfdf0ce6 (diff) | |
download | px4-firmware-bb3792bcdd8edeb24cad7ef0170c76a552f943d5.tar.gz px4-firmware-bb3792bcdd8edeb24cad7ef0170c76a552f943d5.tar.bz2 px4-firmware-bb3792bcdd8edeb24cad7ef0170c76a552f943d5.zip |
mavlink: use LL_FOREACH
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/mavlink/mavlink_main.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/modules/mavlink/mavlink_main.cpp b/src/modules/mavlink/mavlink_main.cpp index c5055939e..58393e013 100644 --- a/src/modules/mavlink/mavlink_main.cpp +++ b/src/modules/mavlink/mavlink_main.cpp @@ -401,14 +401,12 @@ Mavlink::instance_exists(const char *device_name, Mavlink *self) void Mavlink::forward_message(mavlink_message_t *msg, Mavlink *self) { - Mavlink *inst = ::_mavlink_instances; - - while (inst != nullptr) { - /* don't broadcast to itself */ + + Mavlink *inst; + LL_FOREACH(_mavlink_instances, inst) { if (inst != self) { inst->pass_message(msg); } - inst = inst->next; } } |