From 056ebf0b6e511958087470812b1f629fcc44dd70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Barnab=C3=A1s=20P=C5=91cze?= Date: Thu, 6 Feb 2025 15:51:57 +0100 Subject: libcamera: camera_manager: Simplify camera lookup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `std::find()` works just fine because `std::shared_ptr` has `operator==()` with the expected semantics. Signed-off-by: Barnabás Pőcze Reviewed-by: Laurent Pinchart Reviewed-by: Kieran Bingham --- src/libcamera/camera_manager.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src') diff --git a/src/libcamera/camera_manager.cpp b/src/libcamera/camera_manager.cpp index 400109f1..b28bd0bd 100644 --- a/src/libcamera/camera_manager.cpp +++ b/src/libcamera/camera_manager.cpp @@ -239,10 +239,7 @@ void CameraManager::Private::removeCamera(std::shared_ptr camera) { MutexLocker locker(mutex_); - auto iter = std::find_if(cameras_.begin(), cameras_.end(), - [camera](std::shared_ptr &c) { - return c.get() == camera.get(); - }); + auto iter = std::find(cameras_.begin(), cameras_.end(), camera); if (iter == cameras_.end()) return; -- cgit v1.2.1