Remove EmptyArrayRef
[alexxy/gromacs.git] / src / gromacs / domdec / collect.cpp
index 1091872a53a5bfeee588cc0e7a9f183b36b1176c..00fd425223a0feabac62d442b4bb6d2f0065185b 100644 (file)
@@ -306,17 +306,17 @@ void dd_collect_state(gmx_domdec_t *dd,
     }
     if (state_local->flags & (1 << estX))
     {
-        gmx::ArrayRef<gmx::RVec> globalXRef = state ? makeArrayRef(state->x) : gmx::EmptyArrayRef();
-        dd_collect_vec(dd, state_local, makeConstArrayRef(state_local->x), globalXRef);
+        auto globalXRef = state ? state->x : gmx::ArrayRef<gmx::RVec>();
+        dd_collect_vec(dd, state_local, state_local->x, globalXRef);
     }
     if (state_local->flags & (1 << estV))
     {
-        gmx::ArrayRef<gmx::RVec> globalVRef = state ? makeArrayRef(state->v) : gmx::EmptyArrayRef();
-        dd_collect_vec(dd, state_local, makeConstArrayRef(state_local->v), globalVRef);
+        auto globalVRef = state ? state->v : gmx::ArrayRef<gmx::RVec>();
+        dd_collect_vec(dd, state_local, state_local->v, globalVRef);
     }
     if (state_local->flags & (1 << estCGP))
     {
-        gmx::ArrayRef<gmx::RVec> globalCgpRef = state ? makeArrayRef(state->cg_p) : gmx::EmptyArrayRef();
-        dd_collect_vec(dd, state_local, makeConstArrayRef(state_local->cg_p), globalCgpRef);
+        auto globalCgpRef = state ? state->cg_p : gmx::ArrayRef<gmx::RVec>();
+        dd_collect_vec(dd, state_local, state_local->cg_p, globalCgpRef);
     }
 }