1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

no need to clear an unusued collection

If the code reaches that line new_constants is no longer needed.
We only need here to iterate over it to discard stuff and done.

Note that constant_watch_stack.new_constants returns a new
reference each time it is invoked, so that #clear call was not
cleaning state in some internal structure (which would have been
a bit dirty as well at this level of coupling).
This commit is contained in:
Xavier Noria 2016-03-16 08:33:31 +01:00
parent 4b80395130
commit bf6b65432b

View file

@ -666,7 +666,7 @@ module ActiveSupport #:nodoc:
return new_constants unless aborting
new_constants.each { |c| remove_constant(c) }.clear
new_constants.each { |c| remove_constant(c) }
end
end