From 6f42c2c6f0543c7231229da7aef402657518f96b Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Mon, 15 Dec 2014 10:12:45 -0200 Subject: [PATCH] shared/gatt-client: Use queue_remove_if This make use of queue_remove_if instead of queue_find + queue_remove whenever possible. --- src/shared/gatt-client.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/shared/gatt-client.c b/src/shared/gatt-client.c index a836773c9..e86c07ffe 100644 --- a/src/shared/gatt-client.c +++ b/src/shared/gatt-client.c @@ -2420,7 +2420,7 @@ bool bt_gatt_client_unregister_notify(struct bt_gatt_client *client, if (!client || !id) return false; - notify_data = queue_find(client->notify_list, match_notify_data_id, + notify_data = queue_remove_if(client->notify_list, match_notify_data_id, UINT_TO_PTR(id)); if (!notify_data) return false; @@ -2428,7 +2428,6 @@ bool bt_gatt_client_unregister_notify(struct bt_gatt_client *client, assert(notify_data->chrc->notify_count > 0); assert(!notify_data->chrc->ccc_write_id); - queue_remove(client->notify_list, notify_data); complete_unregister_notify(notify_data); return true; } -- 2.47.3