mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 22:51:17 +07:00
27 lines
715 B
HTML
27 lines
715 B
HTML
<html>
|
|
<body>
|
|
<p>
|
|
Reports <code>while</code> loops that could be more effectively written as <code>do-while</code> loops.
|
|
There are <code>while</code> loops where the code just before the loop is identical to the code in the body of the loop.
|
|
Replacing with a <code>do-while</code> loop removes the duplicated code.
|
|
For <code>while</code> loops without such duplicated code, the quick fix is offered in the editor as well, but without highlighting.
|
|
</p>
|
|
<p><b>Example:</b></p>
|
|
<pre><code>
|
|
foo();
|
|
while (x) {
|
|
foo();
|
|
}
|
|
</code></pre>
|
|
<p>Can be replaced with:</p>
|
|
<pre><code>
|
|
do {
|
|
foo();
|
|
} while (x);
|
|
</code></pre>
|
|
<!-- tooltip end -->
|
|
<p>
|
|
<small>New in 2024.1</small>
|
|
</p>
|
|
</body>
|
|
</html> |