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.
diff --git a/src/platform/Darwin/BleConnectionDelegateImpl.mm b/src/platform/Darwin/BleConnectionDelegateImpl.mm
index ad10930..39ca6f5 100644
--- a/src/platform/Darwin/BleConnectionDelegateImpl.mm
+++ b/src/platform/Darwin/BleConnectionDelegateImpl.mm
@@ -698,7 +698,7 @@
- (void)removePeripheralsFromCache
{
- for (CBPeripheral * peripheral in [_cachedPeripherals allValues]) {
+ for (CBPeripheral * peripheral in [_cachedPeripherals allKeys]) {
[self removePeripheralFromCache:peripheral];
}
}