Use Ruby 3.1's intersect\? method

This commit is contained in:
Issy Long 2024-01-20 00:38:21 +00:00
parent e9bcb64000
commit eec7a96fbe
No known key found for this signature in database
GPG Key ID: 8247C390DADC67D4

View File

@ -15,7 +15,7 @@ module RuboCop
# For `zap`s, we only care about `trash` arrays. # For `zap`s, we only care about `trash` arrays.
next if name == :zap && !symbols.include?(:trash) next if name == :zap && !symbols.include?(:trash)
# Don't order `uninstall` arrays that contain commands. # Don't order `uninstall` arrays that contain commands.
next if name == :uninstall && (symbols & [:signal, :script, :early_script, :args, :input]).any? next if name == :uninstall && symbols.intersect?([:signal, :script, :early_script, :args, :input])
pair.each_descendant(:array).each do |array| pair.each_descendant(:array).each do |array|
if array.children.length == 1 if array.children.length == 1