EDIT: I forgot to add the loop part of the second code.
Looking at the two code styles
while(some_loop_cont_val)
{
while(pre_x is not done)
{
//do action pre_x
}
//do action x
}
and
while(some_loop_cont_val)
{
if(pre_x is not done)
{
//do action pre_x
}
else
{
//do action x
}
}
The first loop does pre_x (probably an iterative action), then x, the second one does a part of pre_x, then if its not done, continues doing it until its done, then does x. So both do pre_x and then x.
I'm wondering if there are any differences between the two, both efficiency-wise, and in other ways (ie: if there is some subtle effect that would come up only rarely, &c.), or if there is any reason to use one instead of the other in a specific situation, or if it's just a matter of preference.