Skip to content

Commit

Permalink
od: remove Vec::set_len() usage in InputDecoder (#1739)
Browse files Browse the repository at this point in the history
  • Loading branch information
Arcterus committed Feb 23, 2021
1 parent 7341a1a commit 5935876
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/uu/od/src/inputdecoder.rs
Expand Up @@ -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,
Expand Down

0 comments on commit 5935876

Please sign in to comment.