Commit ba1aa68e authored by zork's avatar zork Committed by Commit bot

Convert a couple loops to range based iterators.

BUG=None

Review URL: https://codereview.chromium.org/626633002

Cr-Commit-Position: refs/heads/master@{#297940}
parent 5fbd3dbd
......@@ -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() {
......
......@@ -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.";
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment