Skip to content

Commit c7bd41d

Browse files
Use IO.copy in IO#gets_to_end (#13990)
1 parent b223139 commit c7bd41d

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/io.cr

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -563,10 +563,7 @@ abstract class IO
563563
decoder.write(str)
564564
end
565565
else
566-
buffer = uninitialized UInt8[DEFAULT_BUFFER_SIZE]
567-
while (read_bytes = read(buffer.to_slice)) > 0
568-
str.write buffer.to_slice[0, read_bytes]
569-
end
566+
IO.copy(self, str)
570567
end
571568
end
572569
end

0 commit comments

Comments
 (0)