diff --git a/compiler/passes/src/function_inlining/inline_program.rs b/compiler/passes/src/function_inlining/inline_program.rs index 8e8fea2d9a..7dd1d99c5b 100644 --- a/compiler/passes/src/function_inlining/inline_program.rs +++ b/compiler/passes/src/function_inlining/inline_program.rs @@ -37,8 +37,7 @@ impl ProgramReconstructor for FunctionInliner<'_> { for function_name in order.into_iter() { // None: If `function_name` is not in `input.functions`, then it must be an external function. // TODO: Check that this is indeed an external function. Requires a redesign of the symbol table. - if let Some(function) = function_map.get(&function_name) { - function_set.remove(&function_name); + if let Some(function) = function_map.remove(&function_name) { // Reconstruct the function. let reconstructed_function = self.reconstruct_function(function.clone()); // Add the reconstructed function to the mapping.