Optimization by loop re-factoring
Instead of:
for(int i = 0; i < MAX; ++i)
if(i != ID)
{
// DO SOMETHING
}
}
Use:
for(int i = 0: i < ID; ++i)
{
// DO SOMETHING
}
for(int i = ID; i < MAX; i="">
{
// DO SOMETHING
}
for(int i = 0; i < MAX; ++i)
if(i != ID)
{
// DO SOMETHING
}
}
Use:
for(int i = 0: i < ID; ++i)
{
// DO SOMETHING
}
for(int i = ID; i < MAX; i="">
{
// DO SOMETHING
}