3 ms·
You don’t have to use goto. Set a condition then check it accordingly in the block following the while block and all will be fine.
by sinuhe69 4y ago
You don’t have to use goto. Set a condition then check it accordingly in the block following the while block and all will be fine.
- MattPalmer1086 4y agoYes, that is another way, but it involves setting a value and another test for it. This is in the context of an extremely fast algorithm and the overhead here is not acceptable. It does not always hurt to use goto to implement the correct control flow when required.Arguably, the code is clearer as well. EDIT: I'd prefer to actually have a while else construct though!