3 ms·
A little ugly but you can get it to work without duplicate code by: bool second_loop = false; do { if (second_loop) {...} update_thing(&foo); secon
by onemoreact 15y ago
A little ugly but you can get it to work without duplicate code by:
bool second_loop = false;
do
{
if (second_loop) {...}
update_thing(&foo);
second_loop = true;
} while (foo != 0);
The real question is which is more clear when some else looks at the code. I suspect even if it's shorter and faster while (foo,bar) is less clear to most people than the above code.