From 452842472e9bc3785eaae6eb453918ec60332da4 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Thu, 18 May 2023 21:50:55 -0400 Subject: [PATCH] Fix removePeripheralsFromCache to iterate the right things. (#26670) We're using the things we get out of the iterator as keys into the cache; these are not the values. --- src/platform/Darwin/BleConnectionDelegateImpl.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platform/Darwin/BleConnectionDelegateImpl.mm b/src/platform/Darwin/BleConnectionDelegateImpl.mm index ad1093007473bb..39ca6f58657269 100644 --- a/src/platform/Darwin/BleConnectionDelegateImpl.mm +++ b/src/platform/Darwin/BleConnectionDelegateImpl.mm @@ -698,7 +698,7 @@ - (void)removePeripheralFromCache:(CBPeripheral *)peripheral - (void)removePeripheralsFromCache { - for (CBPeripheral * peripheral in [_cachedPeripherals allValues]) { + for (CBPeripheral * peripheral in [_cachedPeripherals allKeys]) { [self removePeripheralFromCache:peripheral]; } }