Use 64 iovecs in TcpStream::write_buf (#295)

This commit is contained in:
Sean McArthur
2018-01-26 09:17:44 -08:00
committed by Carl Lerche
parent fbdf04f604
commit e140dabed2
+1 -6
View File
@@ -694,12 +694,7 @@ impl<'a> AsyncWrite for &'a TcpStream {
// `bytes_vec` method.
static DUMMY: &[u8] = &[0];
let iovec = <&IoVec>::from(DUMMY);
let mut bufs = [
iovec, iovec, iovec, iovec,
iovec, iovec, iovec, iovec,
iovec, iovec, iovec, iovec,
iovec, iovec, iovec, iovec,
];
let mut bufs = [iovec; 64];
let n = buf.bytes_vec(&mut bufs);
self.io.get_ref().write_bufs(&bufs[..n])
};