mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-06 21:55:38 +07:00
GitOrigin-RevId: 8b2b63fc6db476ca0c2cfe5cadd84db6c4236d0f
26 lines
921 B
HTML
26 lines
921 B
HTML
<html>
|
|
<body>
|
|
Reports cases where the minimum or the maximum of two numbers can be calculated using
|
|
a <code>Math.max()</code> or <code>Math.min()</code> call, instead of doing it manually.
|
|
<p><b>Example:</b></p>
|
|
<pre><code>
|
|
public int min(int a, int b) {
|
|
return b < a ? b : a;
|
|
}
|
|
</code></pre>
|
|
<p>After the quick-fix is applied:</p>
|
|
<pre><code>
|
|
public int min(int a, int b) {
|
|
return Math.min(a, b);
|
|
}
|
|
</code></pre>
|
|
<!-- tooltip end -->
|
|
<p>
|
|
Use the <b>Disable for float and double</b> option to disable this inspection for <code>double</code> and <code>float</code> types.
|
|
This is useful because the quick-fix may slightly change the semantics for <code>float</code>/
|
|
<code>double</code> types when handling <code>NaN</code>. Nevertheless, in most cases this will actually fix
|
|
a subtle bug where <code>NaN</code> is not taken into account.
|
|
</p>
|
|
<p><small>New in 2019.2</small></p>
|
|
</body>
|
|
</html> |