aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2016-03-16 08:33:31 +0100
committerXavier Noria <fxn@hashref.com>2016-03-16 08:33:31 +0100
commitbf6b65432ba3d2765c1fcea90d9969eb87f49625 (patch)
tree6a459e66fc078b836ef92a3432185c10c7416449
parent4b80395130946094a45279ede9ad6a627ff02b08 (diff)
downloadrails-bf6b65432ba3d2765c1fcea90d9969eb87f49625.tar.gz
rails-bf6b65432ba3d2765c1fcea90d9969eb87f49625.tar.bz2
rails-bf6b65432ba3d2765c1fcea90d9969eb87f49625.zip
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).
-rw-r--r--activesupport/lib/active_support/dependencies.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/dependencies.rb b/activesupport/lib/active_support/dependencies.rb
index 7c681092fa..fc0a358645 100644
--- a/activesupport/lib/active_support/dependencies.rb
+++ b/activesupport/lib/active_support/dependencies.rb
@@ -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