Skip to content

Commit

Permalink
Small improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
garth-wells committed Nov 3, 2024
1 parent 6cba9ab commit ef75173
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion python/dolfinx/wrappers/array.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
#include <utility>
#include <vector>

#include <iostream>

namespace nb = nanobind;

namespace dolfinx_wrappers
Expand All @@ -27,7 +29,7 @@ template <typename V>
auto as_nbarray(V&& x, std::size_t ndim, const std::size_t* shape)
{
using _V = std::decay_t<V>;
_V* ptr = new _V(std::move(x));
_V* ptr = new _V(std::forward<V>(x));
return nb::ndarray<typename _V::value_type, nb::numpy>(
ptr->data(), ndim, shape,
nb::capsule(ptr, [](void* p) noexcept { delete (_V*)p; }));
Expand Down

0 comments on commit ef75173

Please sign in to comment.