Reply to thread

Well, you could change nSize inside the for loop, so I'm not sure how the compiler would get out of evaluating it every time, or at least checking that nSize hasn't changed.  Now, the compiler may be smart enough to see that nSize isn't being changed inside the loop and store that calculation.  On that matter I couldn't answer.  Regardless of it all, to maximize performance you should take that calculation out of the 'for' line. (assuming you don't change nSize in the loop of course!)


Top Bottom