Skip to content

Commit

Permalink
Use IO.copy in IO#gets_to_end (crystal-lang#13990)
Browse files Browse the repository at this point in the history
  • Loading branch information
straight-shoota authored and Blacksmoke16 committed Dec 11, 2023
1 parent f0e80b3 commit 25c3ac4
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/io.cr
Original file line number Diff line number Diff line change
Expand Up @@ -563,10 +563,7 @@ abstract class IO
decoder.write(str)
end
else
buffer = uninitialized UInt8[DEFAULT_BUFFER_SIZE]
while (read_bytes = read(buffer.to_slice)) > 0
str.write buffer.to_slice[0, read_bytes]
end
IO.copy(self, str)
end
end
end
Expand Down

0 comments on commit 25c3ac4

Please sign in to comment.