Same comment applies about initializing these locals outside the loop -- actually, they should be factored out before the "if (m_indexForMinMax != NULL)"