Just saw this at work in a code review and was wondering if this style of coding - for loop, doing && like that, seems fine to you or is there a better way of doing the same?
for (int j = 1; j <= ETtop; j++)
{
// Check everything.
int k = ET[j].PriIdx;
for (int z = 1; z <= ET[k].ArgTop; z++ )
{
// Check to make sure every Argument in the equation is valid.
// If it's a calc this is only true if it's been evaluated.
ready = ready && ET[k].Arg[z].Valid;
}
}
ready &= ET[k].Arg[z].Valid, but that might lower readability for some. I'd improve the variable names though, but that's another topic. :) – Lars-Erik Nov 9 '12 at 9:57