mirror of
https://github.com/uutils/coreutils.git
synced 2026-06-10 15:48:22 -07:00
od: remove Vec::set_len() usage in InputDecoder (#1739)
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user