io/OutputStream: use std::span

This commit is contained in:
Max Kellermann
2023-05-15 11:00:21 +02:00
parent e72d27566c
commit 8ba68fdb47
12 changed files with 40 additions and 42 deletions

View File

@@ -15,12 +15,12 @@ static void
Copy(OutputStream &dest, Reader &src)
{
while (true) {
char buffer[4096];
std::byte buffer[4096];
size_t nbytes = src.Read(buffer, sizeof(buffer));
if (nbytes == 0)
break;
dest.Write(buffer, nbytes);
dest.Write(std::span{buffer}.first(nbytes));
}
}