mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-03 00:24:34 +00:00
flip list.walk passed function arguments
This commit is contained in:
parent
94e8c62613
commit
ebcee4021c
2 changed files with 6 additions and 6 deletions
|
@ -696,14 +696,14 @@ impl<'a> BorrowInfState<'a> {
|
||||||
ListWalk | ListWalkUntil | ListWalkBackwards | DictWalk => {
|
ListWalk | ListWalkUntil | ListWalkBackwards | DictWalk => {
|
||||||
match param_map.get_symbol(arguments[2], closure_layout) {
|
match param_map.get_symbol(arguments[2], closure_layout) {
|
||||||
Some(function_ps) => {
|
Some(function_ps) => {
|
||||||
// own the data structure if the function wants to own the element
|
// own the default value if the function wants to own it
|
||||||
if !function_ps[0].borrow {
|
if !function_ps[0].borrow {
|
||||||
self.own_var(arguments[0]);
|
self.own_var(arguments[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// own the default value if the function wants to own it
|
// own the data structure if the function wants to own the element
|
||||||
if !function_ps[1].borrow {
|
if !function_ps[1].borrow {
|
||||||
self.own_var(arguments[1]);
|
self.own_var(arguments[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// own the closure environment if the function needs to own it
|
// own the closure environment if the function needs to own it
|
||||||
|
|
|
@ -643,8 +643,8 @@ impl<'a> Context<'a> {
|
||||||
// borrow data structure based on first argument of the folded function
|
// borrow data structure based on first argument of the folded function
|
||||||
// borrow the default based on second argument of the folded function
|
// borrow the default based on second argument of the folded function
|
||||||
let borrows = [
|
let borrows = [
|
||||||
function_ps[0].borrow,
|
|
||||||
function_ps[1].borrow,
|
function_ps[1].borrow,
|
||||||
|
function_ps[0].borrow,
|
||||||
FUNCTION,
|
FUNCTION,
|
||||||
CLOSURE_DATA,
|
CLOSURE_DATA,
|
||||||
];
|
];
|
||||||
|
@ -656,7 +656,7 @@ impl<'a> Context<'a> {
|
||||||
b_live_vars,
|
b_live_vars,
|
||||||
);
|
);
|
||||||
|
|
||||||
let b = decref_if_owned!(function_ps[0].borrow, arguments[0], b);
|
let b = decref_if_owned!(function_ps[1].borrow, arguments[0], b);
|
||||||
|
|
||||||
let v = create_call!(function_ps.get(2));
|
let v = create_call!(function_ps.get(2));
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue