mirror of
https://github.com/mii443/wasmer.git
synced 2025-12-08 05:38:19 +00:00
Remove some calls to clone() by using into_iter().
This commit is contained in:
@@ -101,11 +101,11 @@ impl Compiler for LLVMCompiler {
|
||||
)
|
||||
})
|
||||
.collect::<Result<Vec<_>, CompileError>>()?
|
||||
.iter()
|
||||
.map(|(compiled_function, function_custom_sections)| {
|
||||
// TODO: remove usage of clone
|
||||
.into_iter()
|
||||
.map(|(mut compiled_function, mut function_custom_sections)| {
|
||||
let first_section = module_custom_sections.len() as u32;
|
||||
for (_, custom_section) in function_custom_sections.iter() {
|
||||
// TODO: remove this call to clone()
|
||||
let mut custom_section = custom_section.clone();
|
||||
for mut reloc in &mut custom_section.relocations {
|
||||
match reloc.reloc_target {
|
||||
@@ -119,7 +119,6 @@ impl Compiler for LLVMCompiler {
|
||||
}
|
||||
module_custom_sections.push(custom_section);
|
||||
}
|
||||
let mut compiled_function = compiled_function.clone();
|
||||
for mut reloc in &mut compiled_function.relocations {
|
||||
match reloc.reloc_target {
|
||||
RelocationTarget::CustomSection(index) => {
|
||||
@@ -132,7 +131,6 @@ impl Compiler for LLVMCompiler {
|
||||
}
|
||||
compiled_function
|
||||
})
|
||||
.into_iter()
|
||||
.collect::<PrimaryMap<LocalFunctionIndex, _>>();
|
||||
|
||||
Ok(Compilation::new(functions, module_custom_sections))
|
||||
|
||||
@@ -490,9 +490,8 @@ impl FuncTranslator {
|
||||
.collect::<Vec<_>>();
|
||||
custom_sections.sort_unstable_by_key(|a| a.0);
|
||||
let custom_sections = custom_sections
|
||||
.iter()
|
||||
// TODO: remove usage of clone
|
||||
.map(|(k, v)| v.clone())
|
||||
.into_iter()
|
||||
.map(|(k, v)| v)
|
||||
.collect::<PrimaryMap<SectionIndex, _>>();
|
||||
|
||||
let function_body = FunctionBody {
|
||||
|
||||
Reference in New Issue
Block a user