mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 03:27:44 +00:00
od: remove Vec::set_len() usage in InputDecoder (#1739)
This commit is contained in:
parent
7341a1a033
commit
5935876f38
1 changed files with 1 additions and 4 deletions
|
@ -38,10 +38,7 @@ impl<'a, I> InputDecoder<'a, I> {
|
|||
peek_length: usize,
|
||||
byte_order: ByteOrder,
|
||||
) -> InputDecoder<I> {
|
||||
let mut bytes: Vec<u8> = Vec::with_capacity(normal_length + peek_length);
|
||||
unsafe {
|
||||
bytes.set_len(normal_length + peek_length);
|
||||
} // fast but uninitialized
|
||||
let bytes = vec![0; normal_length + peek_length];
|
||||
|
||||
InputDecoder {
|
||||
input,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue