Minor performance improments
[alexxy/gromacs.git] / src / gromacs / mdlib / domdec_setup.cpp
index 1d03b26bea2b00791fd2a038811a39e91763075f..0660a849cd4f743634fed72b8f1fbb0848fb843a 100644 (file)
 #include "gmxpre.h"
 
 #include <assert.h>
-#include <cmath>
 #include <stdio.h>
 
+#include <cmath>
+
 #include "gromacs/legacyheaders/domdec.h"
 #include "gromacs/legacyheaders/names.h"
 #include "gromacs/legacyheaders/network.h"
@@ -248,13 +249,13 @@ static int div_up(int n, int f)
 real comm_box_frac(ivec dd_nc, real cutoff, gmx_ddbox_t *ddbox)
 {
     int  i, j, k;
-    rvec bt, nw;
+    rvec nw;
     real comm_vol;
 
     for (i = 0; i < DIM; i++)
     {
-        bt[i] = ddbox->box_size[i]*ddbox->skew_fac[i];
-        nw[i] = dd_nc[i]*cutoff/bt[i];
+        real bt = ddbox->box_size[i]*ddbox->skew_fac[i];
+        nw[i] = dd_nc[i]*cutoff/bt;
     }
 
     comm_vol = 0;