From bb7f702b489009d840c546864de67df5ddd2bc5e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Barnab=C3=A1s=20P=C5=91cze?=
 <barnabas.pocze@ideasonboard.com>
Date: Wed, 5 Feb 2025 17:58:30 +0100
Subject: apps: qcam: Simplify `PixelFormat` search
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

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>
---
 src/apps/qcam/main_window.cpp | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

(limited to 'src')

diff --git a/src/apps/qcam/main_window.cpp b/src/apps/qcam/main_window.cpp
index 3880a846..d2ccbd23 100644
--- a/src/apps/qcam/main_window.cpp
+++ b/src/apps/qcam/main_window.cpp
@@ -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;
-- 
cgit v1.2.1