Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(241)

Unified Diff: components/pairing/fake_controller_pairing_controller.cc

Issue 626633002: Convert a couple loops to range based iterators. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Code review fix Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/pairing/bluetooth_controller_pairing_controller.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/pairing/fake_controller_pairing_controller.cc
diff --git a/components/pairing/fake_controller_pairing_controller.cc b/components/pairing/fake_controller_pairing_controller.cc
index 0b05ee6a9e5c61f0b83bd0c3a0ae7b0d982a1034..6528061dc436a6f8c136160415c6c7a2abebee56 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.";
« no previous file with comments | « components/pairing/bluetooth_controller_pairing_controller.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698