Skip to content

Commit 734fea2

Browse files
hsbtclaude
andcommitted
Use && for the limit conditions in readuntil
The rest of this file uses && in conditional expressions and reserves and/or for control flow, so match that. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent cc604e2 commit 734fea2

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎lib/net/protocol.rb‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,14 +215,14 @@ def readuntil(terminator, ignore_eof = false, limit: nil)
215215
offset = @rbuf_offset
216216
begin
217217
until idx = @rbuf.index(terminator, offset)
218-
if limit and rbuf_size > limit
218+
if limit && rbuf_size > limit
219219
raise ReadLimitExceeded, "terminator not found within #{limit} bytes"
220220
end
221221
offset = @rbuf.bytesize
222222
rbuf_fill
223223
end
224224
len = idx + terminator.bytesize - @rbuf_offset
225-
if limit and len > limit
225+
if limit && len > limit
226226
raise ReadLimitExceeded, "terminator not found within #{limit} bytes"
227227
end
228228
return rbuf_consume(len)

0 commit comments

Comments
 (0)