From 0ed40d2cd4342465cce916c3b6388d1849aef610 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Sun, 18 Aug 2019 01:45:01 +0300 Subject: android: Pass Camera shared pointer to CameraProxy by const reference The CameraProxy is constructed with a Camera instance passed through a shared pointer. It forwards it to the CameraDevice constructor, which takes a reference used for the sole purpose of making an internal copy of the shared pointer. Both constructors can thus take a const reference instead of a value or a mutable reference. This optimises the constructors slightly. Signed-off-by: Laurent Pinchart Reviewed-by: Jacopo Mondi --- src/android/camera_device.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/android/camera_device.cpp') diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp index 999c51e6..9acfed69 100644 --- a/src/android/camera_device.cpp +++ b/src/android/camera_device.cpp @@ -49,7 +49,7 @@ CameraDevice::Camera3RequestDescriptor::~Camera3RequestDescriptor() * to the framework using the designated callbacks. */ -CameraDevice::CameraDevice(unsigned int id, std::shared_ptr &camera) +CameraDevice::CameraDevice(unsigned int id, const std::shared_ptr &camera) : running_(false), camera_(camera), staticMetadata_(nullptr), requestTemplate_(nullptr) { -- cgit v1.2.1