提交 bf6b6543 编写于 作者: X Xavier Noria

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).
上级 4b803951
......@@ -666,7 +666,7 @@ def new_constants_in(*descs)
return new_constants unless aborting
new_constants.each { |c| remove_constant(c) }.clear
new_constants.each { |c| remove_constant(c) }
end
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册