[libcamera-devel] [PATCH] py: Drop redundant std::move()

Laurent Pinchart laurent.pinchart at ideasonboard.com
Wed Jan 25 00:36:24 CET 2023


gcc-13 warns that the valueOrTuple() function has a redundant
std::move() in a return statement:

../../src/py/libcamera/py_helpers.cpp: In instantiation of ‘pybind11::object valueOrTuple(const libcamera::ControlValue&) [with T = bool]’:
../../src/py/libcamera/py_helpers.cpp:38:28:   required from here
../../src/py/libcamera/py_helpers.cpp:28:35: error: redundant move in return statement [-Werror=redundant-move]
   28 |                 return std::move(t);

Drop it.

Signed-off-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
---
 src/py/libcamera/py_helpers.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/py/libcamera/py_helpers.cpp b/src/py/libcamera/py_helpers.cpp
index 79891ab63862..5bedea047e31 100644
--- a/src/py/libcamera/py_helpers.cpp
+++ b/src/py/libcamera/py_helpers.cpp
@@ -25,7 +25,7 @@ static py::object valueOrTuple(const ControlValue &cv)
 		for (size_t i = 0; i < cv.numElements(); ++i)
 			t[i] = v[i];
 
-		return std::move(t);
+		return t;
 	}
 
 	return py::cast(cv.get<T>());

base-commit: 13986d6ce3ab64c44a8f086ef8942f56bbedff63
prerequisite-patch-id: f6a3b225240a9069104d326be29ae2451ba8e9f0
prerequisite-patch-id: 8d95f21764dd480d4197b573e213721a7b6dae42
prerequisite-patch-id: 7eff091a4898b00438bac219873379769811c391
-- 
Regards,

Laurent Pinchart



More information about the libcamera-devel mailing list