diff options
author | zork <zork@chromium.org> | 2014-10-02 16:03:06 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-10-02 23:04:24 +0000 |
commit | ba1aa68e3db415a56c2d16e3183c5ffa0a3ddcc3 (patch) | |
tree | 6062a09428507c546f542f7245f8bbdd53ffaf71 /components/pairing | |
parent | 5fbd3dbd1fba46949bc3802946bff5d0348116b6 (diff) | |
download | chromium_src-ba1aa68e3db415a56c2d16e3183c5ffa0a3ddcc3.zip chromium_src-ba1aa68e3db415a56c2d16e3183c5ffa0a3ddcc3.tar.gz chromium_src-ba1aa68e3db415a56c2d16e3183c5ffa0a3ddcc3.tar.bz2 |
Convert a couple loops to range based iterators.
BUG=None
Review URL: https://codereview.chromium.org/626633002
Cr-Commit-Position: refs/heads/master@{#297940}
Diffstat (limited to 'components/pairing')
-rw-r--r-- | components/pairing/bluetooth_controller_pairing_controller.cc | 7 | ||||
-rw-r--r-- | components/pairing/fake_controller_pairing_controller.cc | 8 |
2 files changed, 5 insertions, 10 deletions
diff --git a/components/pairing/bluetooth_controller_pairing_controller.cc b/components/pairing/bluetooth_controller_pairing_controller.cc index 4c4d855..bf5e7fd 100644 --- a/components/pairing/bluetooth_controller_pairing_controller.cc +++ b/components/pairing/bluetooth_controller_pairing_controller.cc @@ -137,11 +137,8 @@ void BluetoothControllerPairingController::OnStartDiscoverySession( discovery_session_ = discovery_session.Pass(); ChangeStage(STAGE_DEVICES_DISCOVERY); - device::BluetoothAdapter::DeviceList device_list = adapter_->GetDevices(); - for (device::BluetoothAdapter::DeviceList::iterator ix = device_list.begin(); - ix != device_list.end(); ++ix) { - DeviceFound(*ix); - } + for (const auto& device : adapter_->GetDevices()) + DeviceFound(device); } void BluetoothControllerPairingController::OnConnect() { diff --git a/components/pairing/fake_controller_pairing_controller.cc b/components/pairing/fake_controller_pairing_controller.cc index 0b05ee6..6528061 100644 --- a/components/pairing/fake_controller_pairing_controller.cc +++ b/components/pairing/fake_controller_pairing_controller.cc @@ -82,11 +82,9 @@ void FakeControllerPairingController::ApplyConfig(const std::string& config) { base::SplitStringIntoKeyValuePairs(dict["discovery"], '-', '~', &events)) << "Wrong 'discovery' format."; DiscoveryScenario scenario; - for (base::StringPairs::const_iterator event = events.begin(); - event != events.end(); - ++event) { - std::string type = event->first; - std::string device_id = event->second; + for (const auto& event : events) { + const std::string& type = event.first; + const std::string& device_id = event.second; CHECK(type == "F" || type == "L" || type == "N") << "Wrong discovery event type."; CHECK(!device_id.empty() || type == "N") << "Empty device ID."; |