Skip to content

Commit

Permalink
Use IO::DEFAULT_BUFFER_SIZE in Digest#update (#13635)
Browse files Browse the repository at this point in the history
  • Loading branch information
carlhoerberg authored Jul 22, 2023
1 parent a887601 commit 9801815
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/digest/digest.cr
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ abstract class Digest

# Reads the io's data and updates the digest with it.
def update(io : IO) : self
buffer = uninitialized UInt8[4096]
buffer = uninitialized UInt8[IO::DEFAULT_BUFFER_SIZE]
while (read_bytes = io.read(buffer.to_slice)) > 0
self << buffer.to_slice[0, read_bytes]
end
Expand Down

0 comments on commit 9801815

Please sign in to comment.