What is the best approach between the code below where verticesInnerSides.Length / 2 is written in it's complete form each time :
for (int i = 0; i < verticesRoof.Length; i++) {
verticesInnerSides[i * NB_VERTICES + verticesInnerSides.Length / 2] = startInside;
verticesInnerSides[i * NB_VERTICES + verticesInnerSides.Length / 2 + 1] = startInside + Vector3.up * HEIGHT_ROOF;
verticesInnerSides[i * NB_VERTICES + verticesInnerSides.Length / 2 + 2] = endInside;
verticesInnerSides[i * NB_VERTICES + verticesInnerSides.Length / 2 + 3] = endInside + Vector3.up * HEIGHT_ROOF;
}
Or the following where it's written outside the loop once :
myCalculatedVar = verticesInnerSides.Length / 2;
for (int i = 0; i < verticesRoof.Length; i++) {
verticesInnerSides[i * NB_VERTICES + myCalculatedVar] = startInside;
verticesInnerSides[i * NB_VERTICES + myCalculatedVar + 1] = startInside + Vector3.up * HEIGHT_ROOF;
verticesInnerSides[i * NB_VERTICES + myCalculatedVar + 2] = endInside;
verticesInnerSides[i * NB_VERTICES + myCalculatedVar + 3] = endInside + Vector3.up * HEIGHT_ROOF;
}
Will C# compiler optimize this operation in the first case ?