Skip to content

Commit 7e4f5d7

Browse files
author
GHA CI
committed
Automatic deploy to GitHub Pages: d7e20a9
1 parent 24f827c commit 7e4f5d7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

master/index.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -15504,14 +15504,14 @@ <h3>Example</h3>
1550415504
<p>Checks for bit masks that can be replaced by a call
1550515505
to <code>trailing_zeros</code></p>
1550615506
<h3>Why is this bad?</h3>
15507-
<p><code>x.trailing_zeros() &gt; 4</code> is much clearer than <code>x &amp; 15 == 0</code></p>
15507+
<p><code>x.trailing_zeros() &gt;= 4</code> is much clearer than <code>x &amp; 15 == 0</code></p>
1550815508
<h3>Known problems</h3>
1550915509
<p>llvm generates better code for <code>x &amp; 15 == 0</code> on x86</p>
1551015510
<h3>Example</h3>
1551115511
<pre><code class="language-rust">if x &amp; 0b1111 == 0 { }
1551215512
</code></pre>
1551315513
<p>Use instead:</p>
15514-
<pre><code class="language-rust">if x.trailing_zeros() &gt; 4 { }
15514+
<pre><code class="language-rust">if x.trailing_zeros() &gt;= 4 { }
1551515515
</code></pre>
1551615516
<h3>Configuration</h3>
1551715517
<ul>

0 commit comments

Comments
 (0)