Skip to content

Commit 23cca19

Browse files
committed
🎨 Simplify get_response loop further
1 parent 578344e commit 23cca19

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

lib/net/imap.rb

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2926,11 +2926,8 @@ def get_response
29262926
buff = String.new
29272927
while true
29282928
get_response_line(buff) or break
2929-
if /\{(\d+)\}\r\n\z/n =~ buff
2930-
get_response_literal(buff, $1.to_i) or break
2931-
else
2932-
break
2933-
end
2929+
break unless /\{(\d+)\}\r\n\z/n =~ buff
2930+
get_response_literal(buff, $1.to_i) or break
29342931
end
29352932
return nil if buff.length == 0
29362933
$stderr.print(buff.gsub(/^/n, "S: ")) if config.debug?

0 commit comments

Comments
 (0)