diff options
author | Julian Oes <julian@oes.ch> | 2014-04-07 21:42:48 +0200 |
---|---|---|
committer | Julian Oes <julian@oes.ch> | 2014-04-18 22:05:45 +0200 |
commit | 01d9d482c3237250420e182e0aedd409c365f848 (patch) | |
tree | ecf49267ab2c29afd1d9f87cac81ce2ce0cf171c /src/modules/mavlink | |
parent | 3dd64086e49192aabc020b50f48d68233bad392f (diff) | |
download | px4-firmware-01d9d482c3237250420e182e0aedd409c365f848.tar.gz px4-firmware-01d9d482c3237250420e182e0aedd409c365f848.tar.bz2 px4-firmware-01d9d482c3237250420e182e0aedd409c365f848.zip |
mavlink: use LL_FOREACH
Diffstat (limited to 'src/modules/mavlink')
-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 bb73b8088..3d897431a 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; } } |