Prefer Tuple over Array to format a message to reduce GC

This commit is contained in:
Vitalii Elenhaupt 2018-05-13 14:59:30 +03:00
parent fafe264d40
commit 7a4fcec5ce
No known key found for this signature in database
GPG key ID: 7558EF3A4056C706

View file

@ -58,7 +58,7 @@ module Ameba::Rule
next if argument.ignored? || scope.references?(argument.variable)
name_suggestion = scope.node.is_a?(Crystal::Block) ? '_' : "_#{argument.name}"
source.error self, argument.location, MSG % [argument.name, name_suggestion]
source.error self, argument.location, MSG % {argument.name, name_suggestion}
end
end
end