Skip to content

Commit 063b56d

Browse files
authored
Merge pull request #489 from dvandersluis/use-node-groups
Use node groups in node patterns to replace unions of types
2 parents 61bd21a + fbc7529 commit 063b56d

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/rubocop/cop/performance/array_semi_infinite_range_slice.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ class ArraySemiInfiniteRangeSlice < Base
4444

4545
def_node_matcher :endless_range?, <<~PATTERN
4646
{
47-
({irange erange} nil? (int positive?))
48-
({irange erange} (int positive?) nil?)
47+
(range nil? (int positive?))
48+
(range (int positive?) nil?)
4949
}
5050
PATTERN
5151

lib/rubocop/cop/performance/range_include.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class RangeInclude < Base
3838
# (We don't even catch it if the Range is in double parens)
3939

4040
def_node_matcher :range_include, <<~PATTERN
41-
(call {irange erange (begin {irange erange})} ${:include? :member?} ...)
41+
(call {range (begin range)} ${:include? :member?} ...)
4242
PATTERN
4343

4444
def on_send(node)

0 commit comments

Comments
 (0)