mirror of
https://gitea.invidious.io/iv-org/shard-ameba.git
synced 2024-08-15 00:53:29 +00:00
Deploying to gh-pages from @ cd18c6a000
🚀
This commit is contained in:
parent
8b14685ad7
commit
b143fb0a6d
104 changed files with 2691 additions and 622 deletions
|
@ -451,6 +451,11 @@
|
|||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="ameba/Ameba/Rule/Performance/Base" data-name="ameba::rule::performance::base">
|
||||
<a href="../../../Ameba/Rule/Performance/Base.html">Base</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="ameba/Ameba/Rule/Performance/ChainedCallWithNoBang" data-name="ameba::rule::performance::chainedcallwithnobang">
|
||||
<a href="../../../Ameba/Rule/Performance/ChainedCallWithNoBang.html">ChainedCallWithNoBang</a>
|
||||
|
||||
|
@ -620,7 +625,7 @@
|
|||
</h1>
|
||||
|
||||
|
||||
<ul class="superclass-hierarchy"><li class="superclass"><a href="../../../Ameba/Rule/Performance/FlattenAfterMap.html">Ameba::Rule::Performance::FlattenAfterMap</a></li><li class="superclass"><a href="../../../Ameba/Rule/Base.html">Ameba::Rule::Base</a></li><li class="superclass">Reference</li><li class="superclass">Object</li></ul>
|
||||
<ul class="superclass-hierarchy"><li class="superclass"><a href="../../../Ameba/Rule/Performance/FlattenAfterMap.html">Ameba::Rule::Performance::FlattenAfterMap</a></li><li class="superclass"><a href="../../../Ameba/Rule/Performance/Base.html">Ameba::Rule::Performance::Base</a></li><li class="superclass"><a href="../../../Ameba/Rule/Base.html">Ameba::Rule::Base</a></li><li class="superclass">Reference</li><li class="superclass">Object</li></ul>
|
||||
|
||||
|
||||
|
||||
|
@ -688,7 +693,7 @@
|
|||
</h2>
|
||||
|
||||
|
||||
<a href="https://github.com/crystal-ameba/ameba/blob/7c586eb9/src/ameba/rule/performance/flatten_after_map.cr#L22" target="_blank">
|
||||
<a href="https://github.com/crystal-ameba/ameba/blob/cd18c6a0/src/ameba/rule/performance/flatten_after_map.cr#L24" target="_blank">
|
||||
ameba/rule/performance/flatten_after_map.cr
|
||||
</a>
|
||||
|
||||
|
@ -741,6 +746,8 @@
|
|||
<li class="entry-summary">
|
||||
<a href="#new(ctx:YAML::ParseContext,node:YAML::Nodes::Node)-class-method" class="signature"><strong>.new</strong>(ctx : YAML::ParseContext, node : YAML::Nodes::Node)</a>
|
||||
|
||||
<div class="summary"><p>This rule is used to identify usage of <code>flatten</code> calls that follow <code>map</code>.</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
|
@ -836,6 +843,54 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3>Instance methods inherited from class <code><a href="../../../Ameba/Rule/Performance/Base.html">Ameba::Rule::Performance::Base</a></code></h3>
|
||||
|
||||
|
||||
<a href="../../../Ameba/Rule/Performance/Base.html#catch(source:Source)-instance-method" class="tooltip">
|
||||
<span>catch(source : Source)</span>
|
||||
catch</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3>Constructor methods inherited from class <code><a href="../../../Ameba/Rule/Performance/Base.html">Ameba::Rule::Performance::Base</a></code></h3>
|
||||
|
||||
|
||||
<a href="../../../Ameba/Rule/Performance/Base.html#new(ctx:YAML::ParseContext,node:YAML::Nodes::Node)-class-method" class="tooltip">
|
||||
<span>new(ctx : YAML::ParseContext, node : YAML::Nodes::Node)<br/>new(config = <span class="n">nil</span>)</span>
|
||||
new</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -957,6 +1012,24 @@
|
|||
<a class="method-permalink" href="#new(ctx:YAML::ParseContext,node:YAML::Nodes::Node)-class-method">#</a>
|
||||
</div>
|
||||
|
||||
<div class="doc">
|
||||
|
||||
<p>This rule is used to identify usage of <code>flatten</code> calls that follow <code>map</code>.</p>
|
||||
|
||||
<p>For example, this is considered inefficient:</p>
|
||||
|
||||
<pre><code class="language-crystal"><span class="s">%w[Alice Bob]</span>.map(<span class="o">&</span>.chars).flatten</code></pre>
|
||||
|
||||
<p>And can be written as this:</p>
|
||||
|
||||
<pre><code class="language-crystal"><span class="s">%w[Alice Bob]</span>.flat_map(<span class="o">&</span>.chars)</code></pre>
|
||||
|
||||
<p>YAML configuration example:</p>
|
||||
|
||||
<pre><code class="language-crystal">Performance/FlattenAfterMap:
|
||||
Enabled: true</code></pre>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
|
@ -992,7 +1065,7 @@
|
|||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/7c586eb9/src/ameba/rule/performance/flatten_after_map.cr#L22" target="_blank">View source</a>]
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/cd18c6a0/src/ameba/rule/performance/flatten_after_map.cr#L24" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1134,7 +1207,7 @@
|
|||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/7c586eb9/src/ameba/rule/performance/flatten_after_map.cr#L40" target="_blank">View source</a>]
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/cd18c6a0/src/ameba/rule/performance/flatten_after_map.cr#L42" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1150,7 +1223,7 @@
|
|||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/7c586eb9/src/ameba/rule/performance/flatten_after_map.cr#L31" target="_blank">View source</a>]
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/cd18c6a0/src/ameba/rule/performance/flatten_after_map.cr#L33" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue