From 9f09957ece3bbd13b0f9fe9535947a402db445d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20=C5=A0mucr?= Date: Thu, 30 Nov 2017 14:53:21 +0100 Subject: [PATCH] Use "while ... do" instead of "loop do" Minor code refactoring. --- lib/logstash/outputs/tcp.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/logstash/outputs/tcp.rb b/lib/logstash/outputs/tcp.rb index fa23d72..319df78 100644 --- a/lib/logstash/outputs/tcp.rb +++ b/lib/logstash/outputs/tcp.rb @@ -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.