Skip to content

Commit

Permalink
Use "while ... do" instead of "loop do"
Browse files Browse the repository at this point in the history
Minor code refactoring.
  • Loading branch information
jsmucr authored Nov 30, 2017
1 parent 831f2b9 commit 9f09957
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/logstash/outputs/tcp.rb
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,7 @@ def register
begin
client_socket = connect unless client_socket
r,w,e = IO.select([client_socket], [client_socket], [client_socket], nil)
loop do
break if !r.any?
while r.any? do
# don't expect any reads, but a readable socket might
# mean the remote end closed, so read it and throw it away.
# we'll get an EOFError if it happens.
Expand Down

0 comments on commit 9f09957

Please sign in to comment.