Skip to content

Commit 349ae04

Browse files
committedJan 31, 2025·
Suppress RuboCop's offenses
Follow up rubocop/rubocop#13772
1 parent 2d36cac commit 349ae04

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed
 

‎lib/rubocop/cop/performance/fixed_size.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def allowed_argument?(arg)
7575
end
7676

7777
def allowed_parent?(node)
78-
node && (node.casgn_type? || node.block_type?)
78+
node&.type?(:casgn, :block)
7979
end
8080

8181
def contains_splat?(node)

‎lib/rubocop/cop/performance/redundant_match.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def requires_parentheses_for_call_like?(arg)
8484
end
8585

8686
def call_like?(arg)
87-
arg.call_type? || arg.yield_type? || arg.super_type?
87+
arg.type?(:call, :yield, :super)
8888
end
8989
end
9090
end

‎lib/rubocop/cop/performance/regexp_match.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ def scope_body(node)
239239

240240
def scope_root(node)
241241
node.each_ancestor.find do |ancestor|
242-
ancestor.def_type? || ancestor.defs_type? || ancestor.class_type? || ancestor.module_type?
242+
ancestor.type?(:def, :defs, :class, :module)
243243
end
244244
end
245245

‎lib/rubocop/cop/performance/times_map.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def check(node)
6969

7070
def handleable_receiver?(node)
7171
receiver = node.receiver.receiver
72-
return true if receiver.literal? && (receiver.int_type? || receiver.float_type?)
72+
return true if receiver.literal? && receiver.type?(:int, :float)
7373

7474
node.receiver.dot?
7575
end

0 commit comments

Comments
 (0)
Please sign in to comment.