Bluetooth: GATT: Improve notification code

Only checks if consolidated CCC value matches with data->type once.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This commit is contained in:
Luiz Augusto von Dentz 2017-07-20 15:36:26 +03:00 committed by Johan Hedberg
commit 737c50b50f

View file

@ -698,16 +698,15 @@ static u8_t notify_cb(const struct bt_gatt_attr *attr, void *user_data)
}
ccc = attr->user_data;
if (ccc->value != data->type) {
return BT_GATT_ITER_CONTINUE;
}
/* Notify all peers configured */
for (i = 0; i < ccc->cfg_len; i++) {
struct bt_conn *conn;
int err;
if (ccc->value != data->type) {
continue;
}
conn = bt_conn_lookup_addr_le(&ccc->cfg[i].peer);
if (!conn) {
continue;