From: Brendan Hansen Date: Tue, 22 Sep 2020 20:32:07 +0000 (-0500) Subject: added data parameter to array_map X-Git-Url: https://git.brendanfh.com/?a=commitdiff_plain;h=98b8a0e058272ecf2948d1660d20bc128105eff5;p=onyx.git added data parameter to array_map --- diff --git a/core/array.onyx b/core/array.onyx index d6a58069..a8b6f39c 100644 --- a/core/array.onyx +++ b/core/array.onyx @@ -119,6 +119,6 @@ array_fold :: proc (arr: ^[..] $T, init: $R, f: proc (T, R) -> R) -> R { return val; } -array_map :: proc (arr: ^[..] $T, f: proc (T) -> T) { - for ^it: *arr do *it = f(*it); +array_map :: proc (arr: ^[..] $T, data: $R, f: proc (T, R) -> T) { + for ^it: *arr do *it = f(*it, data); }