diff --git a/lib/rubocop/cop/performance/sum.rb b/lib/rubocop/cop/performance/sum.rb index 8662081e0..f91a80039 100644 --- a/lib/rubocop/cop/performance/sum.rb +++ b/lib/rubocop/cop/performance/sum.rb @@ -159,7 +159,7 @@ def empty_array_literal?(node) def array_literal?(node) receiver = node.children.first - receiver&.literal? && receiver&.array_type? + receiver&.literal? && receiver.array_type? end def autocorrect(corrector, init, range)