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

Refactor to not call path.ast twice

This commit is contained in:
Carlos Antonio da Silva 2013-01-06 10:52:36 -02:00
parent 706fb0184d
commit 94ecbb7e7b

View file

@ -31,8 +31,9 @@ module ActionDispatch
def ast
@decorated_ast ||= begin
path.ast.grep(Nodes::Terminal).each { |n| n.memo = self }
path.ast
decorated_ast = path.ast
decorated_ast.grep(Nodes::Terminal).each { |n| n.memo = self }
decorated_ast
end
end