OSDN Git Service

gd: Fix address manager bug
authorChienyuan <chienyuanhuang@google.com>
Thu, 4 Mar 2021 13:36:50 +0000 (21:36 +0800)
committerChienyuan <chienyuanhuang@google.com>
Thu, 4 Mar 2021 13:36:50 +0000 (21:36 +0800)
Tag: #gd-refactor
Bug: 180869951
Test: gd/cert/run
Change-Id: Ia04aea10c686c8c4ec8985f2ba3f3424691ea825

gd/hci/le_address_manager.cc

index 83b3ebc..b030e23 100644 (file)
@@ -194,7 +194,7 @@ AddressWithType LeAddressManager::GetAnotherAddress() {
 }
 
 void LeAddressManager::pause_registered_clients() {
-  for (auto client : registered_clients_) {
+  for (auto& client : registered_clients_) {
     if (client.second != ClientState::PAUSED && client.second != ClientState::WAITING_FOR_PAUSE) {
       client.second = ClientState::WAITING_FOR_PAUSE;
       client.first->OnPause();
@@ -229,7 +229,7 @@ void LeAddressManager::resume_registered_clients() {
     return;
   }
 
-  for (auto client : registered_clients_) {
+  for (auto& client : registered_clients_) {
     client.second = ClientState::WAITING_FOR_RESUME;
     client.first->OnResume();
   }