Avoid unneeded calls to .as_slice().

This commit is contained in:
Dan Gohman
2017-09-01 10:12:23 -07:00
parent 9d2fbdae62
commit fe12fe0e63
4 changed files with 17 additions and 31 deletions

View File

@@ -369,7 +369,7 @@ pub fn parse_elements_section(
ParserState::ElementSectionEntryBody(ref elements) => {
let elems: Vec<FunctionIndex> =
elements.iter().map(|&x| x as FunctionIndex).collect();
runtime.declare_table_elements(table_index, offset, elems.as_slice())
runtime.declare_table_elements(table_index, offset, &elems)
}
ref s => return Err(SectionParsingError::WrongSectionContent(format!("{:?}", s))),
};