escape more less-than characters in inspection description code samples

GitOrigin-RevId: c9096571bbbcf55fc051294d68a9b7b6d4c54836
This commit is contained in:
Bas Leijdekkers
2021-05-04 09:30:45 +00:00
committed by intellij-monorepo-bot
parent 87881e60b4
commit 9be2dfcea8
4 changed files with 27 additions and 27 deletions
@@ -6,7 +6,7 @@ have adverse performance implications.
<p>Example:</p>
<pre><code>
void foo(Object[] x) {
for (int i = 0; i < x.length; i++) { /**/ }
for (int i = 0; i &lt; x.length; i++) { /**/ }
}
</code></pre>
<!-- tooltip end -->
@@ -2,28 +2,28 @@
<body>
Reports methods that contain more than one loop statement.
<p>For example, this method contains two loops so it will be reported:</p>
<pre>
<pre><code>
void methodWithTwoLoops(int n1, int n2) {
for (int i = 0; i < n1; i++) {
for (int i = 0; i &lt; n1; i++) {
System.out.println(i);
}
int j = 0;
while (j < n2) {
while (j &lt; n2) {
System.out.println(j);
j++;
}
}
</pre>
<p>This method will also be reported, since in contains nested loop:</p>
<pre>
</code></pre>
<p>This method will also be reported, since it contains a nested loop:</p>
<pre><code>
void methodWithNestedLoop(int n1, int n2) {
for (int i = 0; i < n1; i++) {
for (int j = 0; j < n2; j++) {
for (int i = 0; i &lt; n1; i++) {
for (int j = 0; j &lt; n2; j++) {
System.out.println(i + j);
}
}
}
</pre>
</code></pre>
</body>
</html>
@@ -12,9 +12,9 @@ for a possible performance improvement.
<pre><code>
int y = x * 4;
</code></pre>
A quick-fix is suggested to replace multiplication or division operation with shift:
A quick-fix is suggested to replace the multiplication or division operation with shift:
<pre><code>
int y = x << 2;
int y = x &lt;&lt; 2;
</code></pre>
<!-- tooltip end -->
<p>
@@ -2,21 +2,21 @@
<body>
<p>Reports chained comparisons that can be simplified.</p>
<p><b>Example:</b></p>
<pre style="font-family: monospace">
def do_comparison(x):
xmin = 10
xmax = 100
if x >= xmin and x <= xmax:
pass
</pre>
<p>The IDE offers to simplify <code>if x >= xmin and x <= xmax</code>.
<pre><code>
def do_comparison(x):
xmin = 10
xmax = 100
if x >= xmin and x &lt;= xmax:
pass
</code></pre>
<p>The IDE offers to simplify <code>if x >= xmin and x &lt;= xmax</code>.
When the quick-fix is applied, the code changes to:</p>
<pre style="font-family: monospace">
def do_comparison(x):
xmin = 10
xmax = 100
if xmin <= x <= xmax:
pass
</pre>
<pre><code>
def do_comparison(x):
xmin = 10
xmax = 100
if xmin &lt;= x &lt;= xmax:
pass
</code></pre>
</body>
</html>