Skip to content

Commit

Permalink
Merge pull request #585 from Maumagnaguagno/refactor-buffering-methods
Browse files Browse the repository at this point in the history
Refactor Buffering consume_rbuff and getbyte methods
  • Loading branch information
rhenium authored Aug 31, 2023
2 parents 5ccd76c + 5f6abff commit 2dc1253
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions lib/openssl/buffering.rb
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,7 @@ def consume_rbuff(size=nil)
nil
else
size = @rbuffer.size unless size
ret = @rbuffer[0, size]
@rbuffer[0, size] = ""
ret
@rbuffer.slice!(0, size)
end
end

Expand All @@ -106,8 +104,7 @@ def consume_rbuff(size=nil)
#
# Get the next 8bit byte from `ssl`. Returns `nil` on EOF
def getbyte
byte = read(1)
byte && byte.unpack1("C")
read(1)&.ord
end

##
Expand Down

0 comments on commit 2dc1253

Please sign in to comment.