Skip to content

Commit

Permalink
Fix C FFI for array extend
Browse files Browse the repository at this point in the history
  • Loading branch information
Felix Schlitter committed Sep 21, 2018
1 parent 6457545 commit 2d9665c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Control/Extend.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

PURS_FFI_FUNC_2(Control_Extend_arrayExtend, f, _xs, {
int i;
purs_vec_t * innerCopy;
const purs_vec_t * innerCopy;
const purs_any_t * tmp;
const purs_vec_t * xs = purs_any_get_array(_xs);
purs_vec_t * copy = (purs_vec_t *) purs_vec_copy(xs);
purs_vec_foreach(copy, tmp, i) {
innerCopy = purs_vec_slice(xs, i);
copy->data[i] = purs_any_app(f, innerCopy);
copy->data[i] = purs_any_app(f, PURS_ANY_ARRAY_NEW(innerCopy));
}
return PURS_ANY_ARRAY_NEW((const purs_vec_t *) copy);
})

0 comments on commit 2d9665c

Please sign in to comment.