Skip to content

Commit ac3d9ff

Browse files
committed
move the slice
1 parent 2e621e8 commit ac3d9ff

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/MeshField.hpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@ class Field {
1111
Slice slice;
1212

1313
public:
14-
Field(Slice& s) {
15-
slice = s;
16-
}
14+
Field(Slice s) : slice(s) {}
1715

1816
KOKKOS_INLINE_FUNCTION
1917
auto& operator()(int s, int a) const {
@@ -47,7 +45,7 @@ class MeshField {
4745
template <std::size_t index>
4846
auto makeField() {
4947
auto slice = sliceController.template makeSlice<index>();
50-
return Field(slice);
48+
return Field(std::move(slice));
5149
}
5250

5351
template<typename FunctorType>

0 commit comments

Comments
 (0)