diff options
author | Barnabás Pőcze <barnabas.pocze@ideasonboard.com> | 2025-02-06 15:51:57 +0100 |
---|---|---|
committer | Barnabás Pőcze <barnabas.pocze@ideasonboard.com> | 2025-04-01 11:42:00 +0200 |
commit | 056ebf0b6e511958087470812b1f629fcc44dd70 (patch) | |
tree | c5721f49e8aa8ac9e95e4a03c533571e1c1ad86d /src | |
parent | ceea066fa23c780eed65efbb243b216c7f511db8 (diff) |
libcamera: camera_manager: Simplify camera lookup
`std::find()` works just fine because `std::shared_ptr` has
`operator==()` with the expected semantics.
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>
Diffstat (limited to 'src')
-rw-r--r-- | src/libcamera/camera_manager.cpp | 5 |
1 files changed, 1 insertions, 4 deletions
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> camera) { MutexLocker locker(mutex_); - auto iter = std::find_if(cameras_.begin(), cameras_.end(), - [camera](std::shared_ptr<Camera> &c) { - return c.get() == camera.get(); - }); + auto iter = std::find(cameras_.begin(), cameras_.end(), camera); if (iter == cameras_.end()) return; |