Commit 4461bd9e authored by Tristan Matthews's avatar Tristan Matthews
Browse files

* #28351: videov4l2list: use range-based for loops

parent 9f73d64f
...@@ -195,8 +195,8 @@ namespace { ...@@ -195,8 +195,8 @@ namespace {
void giveUniqueName(VideoV4l2Device &dev, const vector<VideoV4l2Device> &devices) void giveUniqueName(VideoV4l2Device &dev, const vector<VideoV4l2Device> &devices)
{ {
start: start:
for (size_t i = 0; i < devices.size(); ++i) { for (auto &iter : devices) {
if (dev.name == devices[i].name) { if (dev.name == iter.name) {
size_t sharp; size_t sharp;
int num = getNumber(dev.name, &sharp); int num = getNumber(dev.name, &sharp);
if (num < 0) // not numbered if (num < 0) // not numbered
...@@ -288,7 +288,7 @@ void VideoV4l2ListThread::delDevice(const string &node) ...@@ -288,7 +288,7 @@ void VideoV4l2ListThread::delDevice(const string &node)
{ {
ScopedLock lock(mutex_); 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) { if (itr->device == node) {
devices_.erase(itr); devices_.erase(itr);
Manager::instance().getVideoControls()->deviceEvent(); Manager::instance().getVideoControls()->deviceEvent();
...@@ -352,8 +352,8 @@ vector<string> VideoV4l2ListThread::getDeviceList() ...@@ -352,8 +352,8 @@ vector<string> VideoV4l2ListThread::getDeviceList()
ScopedLock lock(mutex_); ScopedLock lock(mutex_);
vector<string> v; vector<string> v;
for (std::vector<VideoV4l2Device>::iterator itr = devices_.begin(); itr != devices_.end(); ++itr) for (const auto &itr : devices_)
v.push_back(itr->name.empty() ? itr->device : itr->name); v.push_back(itr.name.empty() ? itr.device : itr.name);
return v; return v;
} }
......
Supports Markdown
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