question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Change do {} while(true) to while(true) {}

See original GitHub issue

These loops in CFR output

do {
...
} while(true);

should be changed to

while(true) {
...
} 

A do while loop insists that the condition is at the end and when I encounter a loop the first thing I want to know is what the condition is. Thus, I am forced to look for the end of the code block of the loop just to find out it is an infinite loop. In conclusion, changing those loops to while loops will improve readability.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:11 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
Lanchoncommented, May 16, 2020

its inevitable, CFR will have to be hostile-forked now

1reaction
Col-Ecommented, May 16, 2020

lol noooo, THAT guy is right, for (;;) is the idiomatic way!

I got a better one 😉

label-begin: {
    // code here
    goto label-begin
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Python While Loop | While True and While Else in Python
The while loop in python is a way to run a code block until the condition returns true repeatedly. Unlike the "for" loop...
Read more >
How to use while True in Python - GeeksforGeeks
In this article, we will discuss how to use while True in Python. While loop is used to execute a block of code...
Read more >
What does "while True" mean in Python? - Stack Overflow
while True means loop forever. The while statement takes an expression and executes the loop body while the expression evaluates to ...
Read more >
While Loops in Python – While True Loop Statement Example
Essentially, a while True loop is a loop that is continuously True and therefore runs endlessly. It will never stop until you force...
Read more >
Java do while loop | DigitalOcean
We can create an infinite loop by passing boolean expression as true in the do while loop. Here is a simple do while...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found