mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-08 06:39:38 +07:00
Review: https://jetbrains.team/p/ij/reviews/98339 It's a concrete quick-fix GitOrigin-RevId: 3388021f0cde4cb49f8c447361c0d8b2fd08cafd
19 lines
523 B
HTML
19 lines
523 B
HTML
<html>
|
|
<body>
|
|
Reports two consecutive comparisons that can be converted to a range check.
|
|
<p>Checking against a range makes code simpler by removing test subject duplication.</p>
|
|
<p><b>Example:</b></p>
|
|
<pre><code>
|
|
fun checkMonth(month: Int): Boolean {
|
|
return month >= 1 && month <= 12
|
|
}
|
|
</code></pre>
|
|
<p>The quick-fix replaces the comparison-based check with a range one:</p>
|
|
<pre><code>
|
|
fun checkMonth(month: Int): Boolean {
|
|
return month in 1..12
|
|
}
|
|
</code></pre>
|
|
<!-- tooltip end -->
|
|
</body>
|
|
</html> |