Skip to content

Commit da3e505

Browse files
committed
[Fix #500] Mark Performance/MapCompact cop as unsafe
1 parent 97af229 commit da3e505

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* [#500](https://github.com/rubocop/rubocop-performance/issues/500): Mark `Performance/MapCompact` cop as unsafe. ([@jbpextra][])

config/default.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ Performance/IoReadlines:
194194
Performance/MapCompact:
195195
Description: 'Use `filter_map` instead of `collection.map(&:do_something).compact`.'
196196
Enabled: pending
197-
SafeAutoCorrect: false
197+
Safe: false
198198
VersionAdded: '1.11'
199199

200200
Performance/MapMethodChain:

lib/rubocop/cop/performance/map_compact.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module Performance
88
# This cop identifies places where `map { ... }.compact` can be replaced by `filter_map`.
99
#
1010
# @safety
11-
# This cop's autocorrection is unsafe because `map { ... }.compact` might yield
11+
# This cop is unsafe because `map { ... }.compact` might yield
1212
# different results than `filter_map`. As illustrated in the example, `filter_map`
1313
# also filters out falsy values, while `compact` only gets rid of `nil`.
1414
#

0 commit comments

Comments
 (0)