Don't allocate on each call to huffman decode

This commit is contained in:
Carl Lerche
2017-06-13 14:39:39 -07:00
parent ab8eac6c05
commit c12a9a86ae
3 changed files with 45 additions and 39 deletions

View File

@@ -664,6 +664,7 @@ mod test {
}
fn huff_decode(src: &[u8]) -> BytesMut {
huffman::decode(src).unwrap()
let mut buf = BytesMut::new();
huffman::decode(src, &mut buf).unwrap()
}
}