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:
parent
dc89e29f49
commit
1db4969dc9
1 changed files with 4 additions and 1 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue