[v1,1/3] libcamera: framebuffer_allocator: move from argument in constructor
diff mbox series

Message ID 20240310012946.727641-2-pobrn@protonmail.com
State Superseded
Headers show
Series
  • couple FrameBufferAllocator changes
Related show

Commit Message

Barnabás Pőcze March 10, 2024, 1:29 a.m. UTC
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(-)

Patch
diff mbox series

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))
 {
 }