rubocop-performance 1.11.2 → 1.11.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rubocop/cop/performance/map_compact.rb +3 -2
- data/lib/rubocop/performance/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 341ace76835db65803b9c7ef7d54f67dbb053c86c9e31b0a80b80f1514e96c29
|
4
|
+
data.tar.gz: 031bda91d5c5d1e66716f218472621c115cf247e364c25596c6fd9f470261aca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3c324e059ffa5f0f98789d6336a41ab0135bdf1dcc8e3b45df83ac8bf75e7bae53fe1e40fb7ae0039d83567bd226709b47cd9cc09184819d16ce8c558d56d85e
|
7
|
+
data.tar.gz: a7c1698db1e6c9c16150f46df944c3f275c38c0f39bca1bc5f0961bdde6a1d14aa9acb9b19823b9f62f352a11120596559fd9cdef6e3343fd8e01bf71b816f96
|
@@ -23,6 +23,7 @@ module RuboCop
|
|
23
23
|
# # good
|
24
24
|
# ary.filter_map(&:foo)
|
25
25
|
# ary.map(&:foo).compact!
|
26
|
+
# ary.compact.map(&:foo)
|
26
27
|
#
|
27
28
|
class MapCompact < Base
|
28
29
|
include RangeHelp
|
@@ -66,8 +67,8 @@ module RuboCop
|
|
66
67
|
chained_method = compact_node.parent
|
67
68
|
compact_method_range = compact_node.loc.selector
|
68
69
|
|
69
|
-
if compact_node.multiline? &&
|
70
|
-
|
70
|
+
if compact_node.multiline? && chained_method&.loc.respond_to?(:selector) &&
|
71
|
+
!invoke_method_after_map_compact_on_same_line?(compact_node, chained_method)
|
71
72
|
range_by_whole_lines(compact_method_range, include_final_newline: true)
|
72
73
|
else
|
73
74
|
compact_method_range
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubocop-performance
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.11.
|
4
|
+
version: 1.11.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bozhidar Batsov
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2021-05-
|
13
|
+
date: 2021-05-06 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rubocop
|