mirror of
https://github.com/boostorg/beast.git
synced 2025-08-03 14:54:32 +02:00
Use memcpy to avoid putting one byte at a time when copying blocks
`memcpy` is likely to be faster than the naive method due to the possibility of use of vector instructions and copying more than a byte at a time. Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
This commit is contained in:
@@ -1298,9 +1298,8 @@ copy_block(
|
|||||||
put_short((std::uint16_t)len);
|
put_short((std::uint16_t)len);
|
||||||
put_short((std::uint16_t)~len);
|
put_short((std::uint16_t)~len);
|
||||||
}
|
}
|
||||||
// VFALCO Use memcpy?
|
std::memcpy(&pending_buf_[pending_], buf, len);
|
||||||
while (len--)
|
pending_ += len;
|
||||||
put_byte(*buf++);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
Reference in New Issue
Block a user