[libcamera-devel,6/8] test: v4l2_subdevice: Remove std::move() that prevents copy elision

Message ID 20190426150155.18652-7-laurent.pinchart@ideasonboard.com
State Accepted
Commit d98ab6f2ae54ed5c97f64479de506bb7ab2e64a5
Headers show
Series
  • Fix clang compilation warnings and errors
Related show

Commit Message

Laurent Pinchart April 26, 2019, 3:01 p.m. UTC
Moving a temporary value prevents copy elision. Remove it.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 test/v4l2_subdevice/v4l2_subdevice_test.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Kieran Bingham April 26, 2019, 4:24 p.m. UTC | #1
On 26/04/2019 17:01, Laurent Pinchart wrote:
> Moving a temporary value prevents copy elision. Remove it.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>


> ---
>  test/v4l2_subdevice/v4l2_subdevice_test.cpp | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/test/v4l2_subdevice/v4l2_subdevice_test.cpp b/test/v4l2_subdevice/v4l2_subdevice_test.cpp
> index dfcf779af95e..72d5f72543d2 100644
> --- a/test/v4l2_subdevice/v4l2_subdevice_test.cpp
> +++ b/test/v4l2_subdevice/v4l2_subdevice_test.cpp
> @@ -39,7 +39,7 @@ int V4L2SubdeviceTest::init()
>  	}
>  
>  	DeviceMatch dm("vimc");
> -	media_ = std::move(enumerator_->search(dm));
> +	media_ = enumerator_->search(dm);
>  	if (!media_) {
>  		cerr << "Unable to find \'vimc\' media device node" << endl;
>  		return TestSkip;
>

Patch

diff --git a/test/v4l2_subdevice/v4l2_subdevice_test.cpp b/test/v4l2_subdevice/v4l2_subdevice_test.cpp
index dfcf779af95e..72d5f72543d2 100644
--- a/test/v4l2_subdevice/v4l2_subdevice_test.cpp
+++ b/test/v4l2_subdevice/v4l2_subdevice_test.cpp
@@ -39,7 +39,7 @@  int V4L2SubdeviceTest::init()
 	}
 
 	DeviceMatch dm("vimc");
-	media_ = std::move(enumerator_->search(dm));
+	media_ = enumerator_->search(dm);
 	if (!media_) {
 		cerr << "Unable to find \'vimc\' media device node" << endl;
 		return TestSkip;