[PATCH v1 1/3] libcamera: framebuffer_allocator: move from argument in constructor

Barnabás Pőcze pobrn at protonmail.com
Sun Mar 10 02:29:54 CET 2024


The single argument, of type `std::shared_ptr<Camera>`,
is passed by value, so it can simply be moved from in order to
avoid calling the copy constructor.
---
 src/libcamera/framebuffer_allocator.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/libcamera/framebuffer_allocator.cpp b/src/libcamera/framebuffer_allocator.cpp
index 94389735..8cf45ab2 100644
--- a/src/libcamera/framebuffer_allocator.cpp
+++ b/src/libcamera/framebuffer_allocator.cpp
@@ -59,7 +59,7 @@ LOG_DEFINE_CATEGORY(Allocator)
  * \param[in] camera The camera
  */
 FrameBufferAllocator::FrameBufferAllocator(std::shared_ptr<Camera> camera)
-	: camera_(camera)
+	: camera_(std::move(camera))
 {
 }
 
-- 
2.44.0




More information about the libcamera-devel mailing list