8000 improved getServiceCount() · usmandroid/esp32-snippets@6a8c821 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6a8c821

Browse files
committed
improved getServiceCount()
1 parent 5a97e68 commit 6a8c821

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

cpp_utils/BLEServer.cpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -120,13 +120,7 @@ BLEService* BLEServer::getServiceByUUID(BLEUUID uuid) {
120120
* @return The amount of registered services
121121
*/
122122
int BLEServer::getServiceCount() {
123-
int count = 0;
124-
if(m_serviceMap.getFirst() == nullptr) return 0;
125-
while(m_serviceMap.getNext() != nullptr){
126-
count++;
127-
}
128-
129-
return count;
123+
return m_serviceMap.size();
130124
}
131125

132126

0 commit comments

Comments
 (0)
0