Skip to content

Commit

Permalink
Merge pull request #131 from nobu/simplify-loop
Browse files Browse the repository at this point in the history
Fix a warning and simplify the loop
  • Loading branch information
nobu authored Feb 29, 2020
2 parents d7cc37c + 4fc5e2a commit a6148e6
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions download-test_readline.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,7 @@ def run
CONNECTIONS.times do
connections << Thread.new do
Net::HTTP.start(URI_GH.host, URI_GH.port, :use_ssl => true,:verify_mode => OpenSSL::SSL::VERIFY_PEER) do |http|
done = false
loop do
break if files.empty?
path, dir, file = files.shift
# x,y,z = [].shift => x is nil
break if path.nil?

while (path, dir, file = files.shift)
uri = URI("#{HOST}/#{BASE}/#{path}/#{file}")
req = Net::HTTP::Get.new uri.request_uri
http.request req do |res|
Expand Down

0 comments on commit a6148e6

Please sign in to comment.