3 ms·
while (true) { if (stop) { break; } } If there only was a way to stop while loop without having to use extra conditional with break...
by harvie 1y ago
while (true) {
if (stop) { break; }
}
If there only was a way to stop while loop without having to use extra conditional with break...
- OskarS 1y agoFeel free to read the article before commenting.
- f1shy 1y agoI’ve read it, and I found nothing to justify that piece of code. Can you please explain?
- bartvk 1y agoThe while loop surrounds the whole thread, which does multiple tasks. The conditional is there to surround some work completing in a reasonable time. That's how I understood, at least.
- f1shy 1y agoDoes not seem so clear to me. If so it could be stated with more pseudo code. Also the eventual need for multiple exit points…