mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 22:09:09 +00:00
Update alias analysis, implementation for List.mapWithIndex
This commit is contained in:
parent
71f2444397
commit
886e4e07f6
4 changed files with 12 additions and 6 deletions
|
@ -210,6 +210,7 @@ pub fn listMap(
|
|||
}
|
||||
}
|
||||
|
||||
// List.mapWithIndex : List before, (before, Nat -> after) -> List after
|
||||
pub fn listMapWithIndex(
|
||||
list: RocList,
|
||||
caller: Caller2,
|
||||
|
@ -231,7 +232,8 @@ pub fn listMapWithIndex(
|
|||
}
|
||||
|
||||
while (i < size) : (i += 1) {
|
||||
caller(data, @ptrCast(?[*]u8, &i), source_ptr + (i * old_element_width), target_ptr + (i * new_element_width));
|
||||
// before, Nat -> after
|
||||
caller(data, source_ptr + (i * old_element_width), @ptrCast(?[*]u8, &i), target_ptr + (i * new_element_width));
|
||||
}
|
||||
|
||||
return output;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue