rubocop-performance 1.11.1 → 1.11.2
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 +7 -1
- 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: a26b6360b5df05f3a7a8dfe957e5ecad0922105024a2e49dae8c39a566f10d88
|
4
|
+
data.tar.gz: 7591fd4d805f4d6dad68b83c8fbffff8e563bfa27bd58030efa48f332c392b2f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c8fb234710212fd000d0d695da71a1b1a36687550cf3738ce987264dad85f015d2f1f1da9b0f511c2147532ff7d6d444b35efb472b399646171bbb35e0ff79ad
|
7
|
+
data.tar.gz: 8447f79bb69e546ff684ece819b626fbfc68db8f7154b1b839c22167c87dbbf58821f1abe626a2b6d486ccfc81601e0844e416a312703ce0be7bc5552f1160ab
|
@@ -63,14 +63,20 @@ module RuboCop
|
|
63
63
|
private
|
64
64
|
|
65
65
|
def compact_method_range(compact_node)
|
66
|
+
chained_method = compact_node.parent
|
66
67
|
compact_method_range = compact_node.loc.selector
|
67
68
|
|
68
|
-
if compact_node.multiline?
|
69
|
+
if compact_node.multiline? &&
|
70
|
+
chained_method && !invoke_method_after_map_compact_on_same_line?(compact_node, chained_method)
|
69
71
|
range_by_whole_lines(compact_method_range, include_final_newline: true)
|
70
72
|
else
|
71
73
|
compact_method_range
|
72
74
|
end
|
73
75
|
end
|
76
|
+
|
77
|
+
def invoke_method_after_map_compact_on_same_line?(compact_node, chained_method)
|
78
|
+
compact_node.loc.selector.line == chained_method.loc.selector.line
|
79
|
+
end
|
74
80
|
end
|
75
81
|
end
|
76
82
|
end
|
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.2
|
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-05 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rubocop
|