Use std::swap in LINCS
[alexxy/gromacs.git] / src / gromacs / mdlib / lincs.cpp
index faa180b1e02aac8fabb15a9b4398a592b5244acb..193487a3b98da1fffea106c7230e18f483232e6d 100644 (file)
@@ -278,11 +278,7 @@ static void lincs_matrix_expand(const Lincs               &lincsd,
             sol[b]  = sol[b] + mvb;
         }
 
-        gmx::ArrayRef<real> swap;
-
-        swap = rhs1;
-        rhs1 = rhs2;
-        rhs2 = swap;
+        std::swap(rhs1, rhs2);
     }   /* nrec*(ncons+2*nrtot) flops */
 
     if (lincsd.ntriangle > 0)
@@ -335,11 +331,7 @@ static void lincs_matrix_expand(const Lincs               &lincsd,
                 sol[b]  = sol[b] + mvb;
             }
 
-            gmx::ArrayRef<real> swap;
-
-            swap = rhs1;
-            rhs1 = rhs2;
-            rhs2 = swap;
+            std::swap(rhs1, rhs2);
         }   /* nrec*(ntriangle + ncc_triangle*2) flops */
 
         if (lincsd.bTaskDepTri)