mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-03 18:51:36 +08:00
mavlink: use LL_FOREACH
This commit is contained in:
@@ -401,14 +401,12 @@ Mavlink::instance_exists(const char *device_name, Mavlink *self)
|
|||||||
void
|
void
|
||||||
Mavlink::forward_message(mavlink_message_t *msg, Mavlink *self)
|
Mavlink::forward_message(mavlink_message_t *msg, Mavlink *self)
|
||||||
{
|
{
|
||||||
Mavlink *inst = ::_mavlink_instances;
|
|
||||||
|
Mavlink *inst;
|
||||||
while (inst != nullptr) {
|
LL_FOREACH(_mavlink_instances, inst) {
|
||||||
/* don't broadcast to itself */
|
|
||||||
if (inst != self) {
|
if (inst != self) {
|
||||||
inst->pass_message(msg);
|
inst->pass_message(msg);
|
||||||
}
|
}
|
||||||
inst = inst->next;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user