- Code: Select all
for (int t = 0; t < n; t++)
i += 1 + ((i + 1) % p == 0) ? p : 0;
Where i, p, n are already provided. I feel like there should be a simpler way of writing this expression.
Well that, and this is actually taking up a significant amount of CPU time because it's being called inside
of an inner loop as the increment operation. That is, there's something like:
- Code: Select all
for (int i = 0; i < end; i = DoComplicatedThing(i, p, n))
{
// ...
}
It's not cheap to say the least. It's taking up 20% of the CPU time.
