Skip to content

Commit

Permalink
[SetuopCodePairer] Add a comment to explain why device discovered ove…
Browse files Browse the repository at this point in the history
…r BLE are using emplace_front and not emplace_back (#24058)
  • Loading branch information
vivien-apple authored and pull[bot] committed Feb 15, 2023
1 parent a196757 commit 7527027
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/controller/SetUpCodePairer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,12 @@ void SetUpCodePairer::OnDiscoveredDeviceOverBle(BLE_CONNECTION_OBJECT connObj)

mWaitingForDiscovery[kBLETransport] = false;

// In order to not wait for all the possible addresses discovered over mdns to
// be tried before trying to connect over BLE, the discovered connection object is
// inserted at the beginning of the list.
//
// It makes it the 'next' thing to try to connect to if there are already some
// discovered parameters in the list.
mDiscoveredParameters.emplace_front(connObj);
ConnectToDiscoveredDevice();
}
Expand Down

0 comments on commit 7527027

Please sign in to comment.