Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Commit

Permalink
Don't call File.realpath in a loop, single call does what we want
Browse files Browse the repository at this point in the history
  • Loading branch information
ojab committed Jul 23, 2018
1 parent 7b603f3 commit 657ea71
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions lib/bundler/shared_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -351,13 +351,9 @@ def clean_load_path

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?
Expand Down

0 comments on commit 657ea71

Please sign in to comment.