diff options
author | ojab <ojab@ojab.ru> | 2018-07-23 08:23:13 +0000 |
---|---|---|
committer | ojab <ojab@ojab.ru> | 2018-07-23 08:29:20 +0000 |
commit | 10b98e7fdc037251346b7878cf50eb4044d01a20 (patch) | |
tree | c6e21ab1e3b7a4ad3bbbd7069fbb910f22f495f9 | |
parent | 7b603f39e32a466cb1a8235a963968b2103e665e (diff) | |
download | bundler-10b98e7fdc037251346b7878cf50eb4044d01a20.tar.gz |
Don't call File.realpath in a loop, single call does what we want
-rw-r--r-- | lib/bundler/shared_helpers.rb | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/bundler/shared_helpers.rb b/lib/bundler/shared_helpers.rb index b85e58ac66..7ff391ab60 100644 --- a/lib/bundler/shared_helpers.rb +++ b/lib/bundler/shared_helpers.rb @@ -351,13 +351,9 @@ module Bundler def resolve_path(path) expanded = File.expand_path(path) - return expanded unless File.respond_to?(:realpath) + return expanded unless File.respond_to?(:realpath) && File.exist?(expanded) - while File.exist?(expanded) && File.realpath(expanded) != expanded - expanded = File.realpath(expanded) - end - - expanded + File.realpath(expanded) end def prints_major_deprecations? |