Skip to content

Commit 593dfca

Browse files
committed
Avoid unecessary hash allocation in AttributeMutationTracker#changes
1 parent 23b1c56 commit 593dfca

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

activemodel/lib/active_model/attribute_mutation_tracker.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def changed_values
2626
def changes
2727
attr_names.each_with_object({}.with_indifferent_access) do |attr_name, result|
2828
if change = change_to_attribute(attr_name)
29-
result.merge!(attr_name => change)
29+
result[attr_name] = change
3030
end
3131
end
3232
end

0 commit comments

Comments
 (0)