mirror of
https://gitea.invidious.io/iv-org/shard-ameba.git
synced 2024-08-15 00:53:29 +00:00
Merge pull request #198 from crystal-ameba/Sija/followup-to-pr-195
This commit is contained in:
commit
79ff1f75db
1 changed files with 4 additions and 5 deletions
|
@ -33,7 +33,6 @@ module Ameba::Rule::Performance
|
||||||
# - sort_by
|
# - sort_by
|
||||||
# - shuffle
|
# - shuffle
|
||||||
# - reverse
|
# - reverse
|
||||||
# - rotate
|
|
||||||
# ```
|
# ```
|
||||||
class ChainedCallsWithNoBang < Base
|
class ChainedCallsWithNoBang < Base
|
||||||
properties do
|
properties do
|
||||||
|
@ -42,15 +41,15 @@ module Ameba::Rule::Performance
|
||||||
# All of those have bang method variants returning `self`
|
# All of those have bang method variants returning `self`
|
||||||
# and are not modifying the receiver type (like `compact` does),
|
# and are not modifying the receiver type (like `compact` does),
|
||||||
# thus are safe to switch to the bang variant.
|
# thus are safe to switch to the bang variant.
|
||||||
call_names : Array(String) = %w(uniq sort sort_by shuffle reverse rotate)
|
call_names : Array(String) = %w(uniq sort sort_by shuffle reverse)
|
||||||
end
|
end
|
||||||
|
|
||||||
# All these methods are allocating a new object
|
# All these methods are allocating a new object
|
||||||
ALLOCATING_METHOD_NAMES = %w(
|
ALLOCATING_METHOD_NAMES = %w(
|
||||||
keys values values_at map map_with_index flat_map compact_map
|
keys values values_at map map_with_index flat_map compact_map
|
||||||
flatten compact select reject combinations permutations sample
|
flatten compact select reject sample group_by chunks tally merge
|
||||||
transpose invert group_by chunks tally merge chars clone
|
combinations repeated_combinations permutations repeated_permutations
|
||||||
captures named_captures
|
transpose invert chars captures named_captures clone
|
||||||
)
|
)
|
||||||
|
|
||||||
MSG = "Use bang method variant `%s!` after chained `%s` call"
|
MSG = "Use bang method variant `%s!` after chained `%s` call"
|
||||||
|
|
Loading…
Reference in a new issue