Skip to content

Commit 9f09957

Browse files
authored
Use "while ... do" instead of "loop do"
Minor code refactoring.
1 parent 831f2b9 commit 9f09957

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/logstash/outputs/tcp.rb

+1-2
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,7 @@ def register
150150
begin
151151
client_socket = connect unless client_socket
152152
r,w,e = IO.select([client_socket], [client_socket], [client_socket], nil)
153-
loop do
154-
break if !r.any?
153+
while r.any? do
155154
# don't expect any reads, but a readable socket might
156155
# mean the remote end closed, so read it and throw it away.
157156
# we'll get an EOFError if it happens.

0 commit comments

Comments
 (0)