diff --git a/source/simulation2/helpers/Grid.h b/source/simulation2/helpers/Grid.h index ba5bf77ec1..6ac0a73045 100644 --- a/source/simulation2/helpers/Grid.h +++ b/source/simulation2/helpers/Grid.h @@ -88,9 +88,8 @@ public: #if GRID_BOUNDS_DEBUG ENSURE(g.m_W == m_W && g.m_H == m_H); #endif - for (int j=0; j < m_H; ++j) - for (int i=0; i < m_W; ++i) - m_Data[j*m_W + i] += g.m_Data[j*m_W + i]; + for (int i=0; i < m_H*m_W; ++i) + m_Data[i] += g.m_Data[i]; } void set(int i, int j, const T& value)