From 4461bd9e5f0a1d13797576c352514b5cab0d8fbd Mon Sep 17 00:00:00 2001
From: Tristan Matthews <tristan.matthews@savoirfairelinux.com>
Date: Tue, 13 Aug 2013 17:20:41 -0400
Subject: [PATCH] * #28351: videov4l2list: use range-based for loops

---
 daemon/src/video/video_v4l2_list.cpp | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/daemon/src/video/video_v4l2_list.cpp b/daemon/src/video/video_v4l2_list.cpp
index 8fadb91160..dc381f6dcd 100644
--- a/daemon/src/video/video_v4l2_list.cpp
+++ b/daemon/src/video/video_v4l2_list.cpp
@@ -195,8 +195,8 @@ namespace {
     void giveUniqueName(VideoV4l2Device &dev, const vector<VideoV4l2Device> &devices)
     {
 start:
-        for (size_t i = 0; i < devices.size(); ++i) {
-            if (dev.name == devices[i].name) {
+        for (auto &iter : devices) {
+            if (dev.name == iter.name) {
                 size_t sharp;
                 int num = getNumber(dev.name, &sharp);
                 if (num < 0) // not numbered
@@ -288,7 +288,7 @@ void VideoV4l2ListThread::delDevice(const string &node)
 {
     ScopedLock lock(mutex_);
 
-    for (std::vector<VideoV4l2Device>::iterator itr = devices_.begin(); itr != devices_.end(); ++itr) {
+    for (auto itr = devices_.begin(); itr != devices_.end(); ++itr) {
         if (itr->device == node) {
             devices_.erase(itr);
             Manager::instance().getVideoControls()->deviceEvent();
@@ -352,8 +352,8 @@ vector<string> VideoV4l2ListThread::getDeviceList()
     ScopedLock lock(mutex_);
     vector<string> v;
 
-    for (std::vector<VideoV4l2Device>::iterator itr = devices_.begin(); itr != devices_.end(); ++itr)
-       v.push_back(itr->name.empty() ? itr->device : itr->name);
+    for (const auto &itr : devices_)
+       v.push_back(itr.name.empty() ? itr.device : itr.name);
 
     return v;
 }
-- 
GitLab