Inline the buffer construction functions
Otherwise there ends up being a copy of the 40-byte buffer. Noticeable improvement on `cargo bench` in the small integer cases compared to parent commit.
This commit is contained in:
parent
762dedb54c
commit
4b662e7486
|
@ -47,6 +47,7 @@ pub struct Buffer {
|
|||
}
|
||||
|
||||
impl Default for Buffer {
|
||||
#[inline]
|
||||
fn default() -> Buffer {
|
||||
Buffer::new()
|
||||
}
|
||||
|
@ -55,6 +56,7 @@ impl Default for Buffer {
|
|||
impl Buffer {
|
||||
/// This is a cheap operation; you don't need to worry about reusing buffers
|
||||
/// for efficiency.
|
||||
#[inline]
|
||||
pub fn new() -> Buffer {
|
||||
Buffer { bytes: unsafe { mem::uninitialized() } }
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue