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

only compute path.to_s once

This commit is contained in:
Aaron Patterson 2011-03-02 15:17:29 -08:00
parent dc89e29f49
commit 1db4969dc9

View file

@ -382,7 +382,10 @@ module Rails
# Finds engine with given path
def find(path)
Rails::Engine::Railties.engines.find { |r| File.expand_path(r.root.to_s) == File.expand_path(path.to_s) }
path = path.to_s
Rails::Engine::Railties.engines.find { |r|
File.expand_path(r.root.to_s) == File.expand_path(path)
}
end
end