From 8915343e0a6dabab733cd7f53c743b0e13229c81 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Mon, 15 Dec 2014 10:07:29 -0200 Subject: [PATCH] shared/att: Use queue_remove_if This make use of queue_remove_if instead of queue_find + queue_remove whenever possible. --- src/shared/att.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/shared/att.c b/src/shared/att.c index 6a733fa6d..956fa8cbd 100644 --- a/src/shared/att.c +++ b/src/shared/att.c @@ -993,12 +993,11 @@ bool bt_att_unregister_disconnect(struct bt_att *att, unsigned int id) if (!att || !id) return false; - disconn = queue_find(att->disconn_list, match_disconn_id, + disconn = queue_remove_if(att->disconn_list, match_disconn_id, UINT_TO_PTR(id)); if (!disconn) return false; - queue_remove(att->disconn_list, disconn); destroy_att_disconn(disconn); return true; } @@ -1211,12 +1210,11 @@ bool bt_att_unregister(struct bt_att *att, unsigned int id) if (!att || !id) return false; - notify = queue_find(att->notify_list, match_notify_id, + notify = queue_remove_if(att->notify_list, match_notify_id, UINT_TO_PTR(id)); if (!notify) return false; - queue_remove(att->notify_list, notify); destroy_att_notify(notify); return true; } -- 2.47.3