Skip to content
This repository has been archived by the owner on Dec 10, 2024. It is now read-only.

Commit

Permalink
feat: use for instead of extend
Browse files Browse the repository at this point in the history
  • Loading branch information
aripiprazole committed Dec 21, 2023
1 parent ce95769 commit 1c150e5
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions src/eval.rs
Original file line number Diff line number Diff line change
Expand Up @@ -231,18 +231,14 @@ impl Fun {

loop {
let mut current_environment = self.environment.frames.write().unwrap();
let mut frame = current_environment.back_mut().unwrap();
let new_environment = associate_parameters(self.parameters.clone(), arguments.clone())?
.into_iter()
.map(|(keyword, value)| {
(keyword.clone(), Definition {
is_macro_definition: false,
name: keyword.name,
value,
})
let frame = current_environment.back_mut().unwrap();
for (name, value) in associate_parameters(self.parameters.clone(), arguments.clone())? {
frame.definitions.insert(name.clone(), Definition {
is_macro_definition: false,
name: name.name,
value,
});

frame.definitions.extend(new_environment);
}
}
}
}
Expand Down

0 comments on commit 1c150e5

Please sign in to comment.