mirror of
https://github.com/espressif/esp-mqtt.git
synced 2025-07-29 18:28:24 +02:00
mqtt_outbox: Use STAILQ_FOREACH for outbox_delete_single_expired
For the delete one entry and return case, no need to use STAILQ_FOREACH_SAFE. Signed-off-by: Axel Lin <axel.lin@ingics.com>
This commit is contained in:
@ -168,8 +168,8 @@ esp_err_t outbox_delete_msgtype(outbox_handle_t outbox, int msg_type)
|
||||
int outbox_delete_single_expired(outbox_handle_t outbox, outbox_tick_t current_tick, outbox_tick_t timeout)
|
||||
{
|
||||
int msg_id = -1;
|
||||
outbox_item_handle_t item, tmp;
|
||||
STAILQ_FOREACH_SAFE(item, outbox, next, tmp) {
|
||||
outbox_item_handle_t item;
|
||||
STAILQ_FOREACH(item, outbox, next) {
|
||||
if (current_tick - item->tick > timeout) {
|
||||
STAILQ_REMOVE(outbox, item, outbox_item, next);
|
||||
free(item->buffer);
|
||||
|
Reference in New Issue
Block a user