[fuzz] Remove unnecessary allocation (#4689)

This resolves a comment @jameysharp made in a previous PR.
This commit is contained in:
Andrew Brown
2022-08-11 12:26:33 -07:00
committed by GitHub
parent e4adc46e6d
commit c4fd6a95da

View File

@@ -47,8 +47,7 @@ impl<'a> SingleInstModule<'a> {
// Encode the code section. // Encode the code section.
let mut codes = CodeSection::new(); let mut codes = CodeSection::new();
let locals = vec![]; let mut f = Function::new([]);
let mut f = Function::new(locals);
for (index, _) in self.parameters.iter().enumerate() { for (index, _) in self.parameters.iter().enumerate() {
f.instruction(&Instruction::LocalGet(index as u32)); f.instruction(&Instruction::LocalGet(index as u32));
} }