lib/rubocop/cop/style/redundant_freeze.rb in rubocop-0.59.2 vs lib/rubocop/cop/style/redundant_freeze.rb in rubocop-0.60.0
- old
+ new
@@ -32,13 +32,23 @@
end
private
def immutable_literal?(node)
+ node = strip_parenthesis(node)
+
return true if node.immutable_literal?
FROZEN_STRING_LITERAL_TYPES.include?(node.type) &&
frozen_string_literals_enabled?
+ end
+
+ def strip_parenthesis(node)
+ if node.begin_type? && node.children.first
+ node.children.first
+ else
+ node
+ end
end
end
end
end
end