Minor code clean-up in the NB FEP kernel.
[alexxy/gromacs.git] / src / gromacs / gmxlib / nonbonded / nb_free_energy.cpp
index 6304d85ef22a4d3f93f8628db5870e7c76ba673d..214e41a9d93de0b01c29b8a0db279bbb4b6e5e79 100644 (file)
@@ -401,8 +401,8 @@ static void nb_free_energy_kernel(const t_nblist&
     const RealType            maxRInvSix(c_maxRInvSix);
     const RealType gmx_unused floatMin(GMX_FLOAT_MIN);
 
-    RealType dvdlCoul(zero);
-    RealType dvdlVdw(zero);
+    RealType dvdlCoul{ zero };
+    RealType dvdlVdw{ zero };
 
     /* Lambda factor for state A, 1-lambda*/
     real LFC[NSTATES], LFV[NSTATES];
@@ -621,10 +621,10 @@ static void nb_free_energy_kernel(const t_nblist&
                     preloadGapsysScaleLinpointVdW[j]  = 0;
                     preloadGapsysScaleLinpointCoul[j] = 0;
 
+                    typeIndices[STATE_A][j] = ntiA + typeA[jjnr[k]];
+                    typeIndices[STATE_B][j] = ntiB + typeB[jjnr[k]];
                     for (int i = 0; i < NSTATES; i++)
                     {
-                        typeIndices[STATE_A][j]      = ntiA + typeA[jjnr[k]];
-                        typeIndices[STATE_B][j]      = ntiB + typeB[jjnr[k]];
                         preloadLjPmeC6Grid[i][j]     = 0;
                         preloadQq[i][j]              = 0;
                         preloadSigma6[i][j]          = 0;