apps: qcam: Simplify PixelFormat
search
Since `PixelFormat` has `operator==()`, `std::find()` can be used directly, so do that to simplify. Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
parent
314ecb5400
commit
bb7f702b48
1 changed files with 1 additions and 4 deletions
|
@ -386,10 +386,7 @@ int MainWindow::startCapture()
|
|||
/* Use a format supported by the viewfinder if available. */
|
||||
std::vector<PixelFormat> formats = vfConfig.formats().pixelformats();
|
||||
for (const PixelFormat &format : viewfinder_->nativeFormats()) {
|
||||
auto match = std::find_if(formats.begin(), formats.end(),
|
||||
[&](const PixelFormat &f) {
|
||||
return f == format;
|
||||
});
|
||||
auto match = std::find(formats.begin(), formats.end(), format);
|
||||
if (match != formats.end()) {
|
||||
vfConfig.pixelFormat = format;
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue