Strange loops
V3028 Consider inspecting the ‘for’ operator. Initial and final values of the iterator are the same. VRage.Render MyRender-Management.cs 1034
internal static void AddDivisionForCullingStructure(List<MyRenderObject> roList, int objectCountLimit, List<BoundingBoxD> resultDivision) { .... for (int axis = bestAxis; axis <= bestAxis; axis++) .... }
The loop counter axis is initialized to the value of bestAxis, but because the same value (or less) is also used as the loop termination condition, the loop won’t iterate at all. The programmer actually wanted the counter to start with 0, in which case the loop should be rewritten as follows:
for (int axis = 0; axis <= bestAxis; axis++)
Please click here to see more bugs from this project.
Actually, the loop would have iterated at least once since the condition is <= (less than or equal), so it's unclear if starting with 0 is what is wanted.
LikeLike