Diff between 369bced349dda675a12a16d09cd68e779864f1b4 and 3c38f71db72b89a30c20f1629c63e83c3cfe1d01

Changed Files

File Additions Deletions Status
android/gatt.c +1 -11 modified

Full Patch

diff --git a/android/gatt.c b/android/gatt.c
index f758c4f..3bc1ced 100644
--- a/android/gatt.c
+++ b/android/gatt.c
@@ -1963,21 +1963,11 @@ static bool build_descr_cache(int32_t conn_id, struct gatt_device *dev,
 					struct characteristic *ch)
 {
 	struct discover_desc_data *cb_data;
-	struct characteristic *next_ch;
 	uint16_t start, end;
 
 	/* Clip range to given characteristic */
 	start = ch->ch.value_handle + 1;
-	end = srvc->primary ? srvc->prim.range.end : srvc->incl.range.end;
-
-	/* Use next characteristic start as end. If there is none -
-	 * service end is valid end.
-	 * TODO: we should cache char end handle to avoid this search
-	 */
-	next_ch = queue_find(srvc->chars, match_char_by_higher_inst_id,
-					INT_TO_PTR(ch->id.instance));
-	if (next_ch)
-		end = next_ch->ch.handle - 1;
+	end = ch->end_handle;
 
 	/* If there are no descriptors, notify with fail status. */
 	if (start > end)