Or better yet, just calculate it once at the top of the inner loop, and use that below.