summaryrefslogtreecommitdiff
path: root/src/libcamera/pipeline/ipu3/ipu3.cpp
diff options
context:
space:
mode:
authorJacopo Mondi <jacopo@jmondi.org>2019-02-12 21:48:10 +0100
committerJacopo Mondi <jacopo@jmondi.org>2019-02-14 05:31:23 +0100
commitddcd8ebb3de0d5938b59eb62b9cf2e5bc430d820 (patch)
treee74d7c79ad01d24ea5814f447757df1361e0a1d7 /src/libcamera/pipeline/ipu3/ipu3.cpp
parentfea6dc9365c3793308e32f2cf73fafd94e144dd1 (diff)
libcamera: device_enumerator: Remove move() on search() return
Remove the std::move() call on the shared_ptr<MediaDevice *> returned by the search() method and remove the std::move() call on temporary return value in pipeline handlers that use the method. Thanks to copy elision, the regular constructor of the newly created object is called, avoiding un-necessary copies. Furthermore, the use of std::move() in the return and assignment statements prevents the compiler from performing copy elision, forcing it to generate two sequences of un-necessary calls to the class' move constructor and destructor. Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Diffstat (limited to 'src/libcamera/pipeline/ipu3/ipu3.cpp')
-rw-r--r--src/libcamera/pipeline/ipu3/ipu3.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp
index 677e127d..9694d0ce 100644
--- a/src/libcamera/pipeline/ipu3/ipu3.cpp
+++ b/src/libcamera/pipeline/ipu3/ipu3.cpp
@@ -278,11 +278,11 @@ bool PipelineHandlerIPU3::match(DeviceEnumerator *enumerator)
imgu_dm.add("ipu3-imgu 1 viewfinder");
imgu_dm.add("ipu3-imgu 1 3a stat");
- cio2_ = std::move(enumerator->search(cio2_dm));
+ cio2_ = enumerator->search(cio2_dm);
if (!cio2_)
return false;
- imgu_ = std::move(enumerator->search(imgu_dm));
+ imgu_ = enumerator->search(imgu_dm);
if (!imgu_)
return false;