flip list.walk passed function arguments

This commit is contained in:
Folkert 2021-10-10 12:35:03 +02:00
parent 94e8c62613
commit ebcee4021c
2 changed files with 6 additions and 6 deletions

View file

@ -696,14 +696,14 @@ impl<'a> BorrowInfState<'a> {
ListWalk | ListWalkUntil | ListWalkBackwards | DictWalk => {
match param_map.get_symbol(arguments[2], closure_layout) {
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 {
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 {
self.own_var(arguments[1]);
self.own_var(arguments[0]);
}
// own the closure environment if the function needs to own it