mirror of
https://github.com/NVIDIA/nvbench.git
synced 2026-05-13 17:55:39 +00:00
Replace use of py::object copy constructor with use of move constructor
Change explicit constructor of benchmark_wrapper_t to use move-constructor of py::object instead of copy constructor by replacing `py::object(o)` with `py::object(std::move(o))`.
This commit is contained in:
@@ -76,7 +76,7 @@ struct benchmark_wrapper_t
|
||||
benchmark_wrapper_t() = default;
|
||||
|
||||
explicit benchmark_wrapper_t(py::object o)
|
||||
: m_fn{std::shared_ptr<py::object>(new py::object(o), PyObjectDeleter{})}
|
||||
: m_fn{std::shared_ptr<py::object>(new py::object(std::move(o)), PyObjectDeleter{})}
|
||||
{
|
||||
if (!PyCallable_Check(m_fn->ptr()))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user