I keep coming across the following pattern in my C code:
_Bool executed = 0;
while (condition) {
executed = 1;
...
}
if (!executed) {
...
}
Is there a better way to construct this?
Ideally:
while (condition) {
executed = 1;
...
} else {
...
}
(A while/else loop, but not with Python's semantics. The else should be only executed if the while condition was immediately false.)