2021-07-29 03:40:06

by Yun-hao Chung

[permalink] [raw]
Subject: [Bluez PATCH v3] gatt-db: remove redundant check in foreach range

From: Yun-Hao Chung <[email protected]>

svc_start < foreach_data->end has already been checked in a few lines
before.

Reviewed-by: Archie Pusaka <[email protected]>
---

Changes in v3:
- resore check svc_start < foreach_data->start and update commit message

Changes in v2:
- remove the entire check

src/shared/gatt-db.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/shared/gatt-db.c b/src/shared/gatt-db.c
index 8bff4d37aaa2..3a02289ce435 100644
--- a/src/shared/gatt-db.c
+++ b/src/shared/gatt-db.c
@@ -1348,9 +1348,9 @@ static void foreach_in_range(void *data, void *user_data)
return;

if (!foreach_data->attr) {
- if (svc_start < foreach_data->start ||
- svc_start > foreach_data->end)
+ if (svc_start < foreach_data->start)
return;
+
return foreach_service_in_range(data, user_data);
}

--
2.32.0.554.ge1b32706d8-goog