rewrites bare loop as until

This commit is contained in:
Xavier Noria 2015-11-11 05:23:29 +01:00
parent fe918b3bc4
commit 0a2e9b02d6

@ -107,9 +107,7 @@ def longest_common_subpath(paths)
lcsp = Pathname.new(paths[0])
paths[1..-1].each do |path|
loop do
break if lcsp.ascendant_of?(path)
until lcsp.ascendant_of?(path)
if lcsp.root?
# If we get here a root directory is not an ascendant of path.
# This may happen if there are paths in different drives on