mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 14:24:45 +00:00
remove closure that is used once
This commit is contained in:
parent
8c44661bc2
commit
1814a69c30
1 changed files with 8 additions and 8 deletions
|
@ -3067,13 +3067,6 @@ fn deep_copy_var_help(
|
||||||
|
|
||||||
visited.push(var);
|
visited.push(var);
|
||||||
|
|
||||||
let make_descriptor = |content| Descriptor {
|
|
||||||
content,
|
|
||||||
rank: max_rank,
|
|
||||||
mark: Mark::NONE,
|
|
||||||
copy: OptVariable::NONE,
|
|
||||||
};
|
|
||||||
|
|
||||||
// Safety: Here we make a variable that is 1 position out of bounds.
|
// Safety: Here we make a variable that is 1 position out of bounds.
|
||||||
// The reason is that we can now keep the mutable reference to `desc`
|
// The reason is that we can now keep the mutable reference to `desc`
|
||||||
// Below, we actually push a new variable onto subs meaning the `copy`
|
// Below, we actually push a new variable onto subs meaning the `copy`
|
||||||
|
@ -3091,7 +3084,14 @@ fn deep_copy_var_help(
|
||||||
|
|
||||||
let content = *subs.get_content_unchecked(var);
|
let content = *subs.get_content_unchecked(var);
|
||||||
|
|
||||||
let actual_copy = subs.fresh(make_descriptor(content));
|
let copy_descriptor = Descriptor {
|
||||||
|
content,
|
||||||
|
rank: max_rank,
|
||||||
|
mark: Mark::NONE,
|
||||||
|
copy: OptVariable::NONE,
|
||||||
|
};
|
||||||
|
|
||||||
|
let actual_copy = subs.fresh(copy_descriptor);
|
||||||
debug_assert_eq!(copy, actual_copy);
|
debug_assert_eq!(copy, actual_copy);
|
||||||
|
|
||||||
macro_rules! copy_sequence {
|
macro_rules! copy_sequence {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue