slightly faster map implementation

see this comment: https://github.com/quantified-uncertainty/squiggle/pull/1047#issuecomment-1241805927
This commit is contained in:
Vyacheslav Matyukhin 2022-09-09 14:39:42 +04:00
parent ecc82ba8f7
commit 4d1f76f80e
No known key found for this signature in database
GPG Key ID: 3D2A774C5489F96C

View File

@ -33,16 +33,14 @@ module Internals = {
eLambdaValue,
reducer: ProjectReducerFnT.t,
): ReducerInterface_InternalExpressionValue.t => {
let mappedList = array->E.A.reduceReverse(list{}, (acc, elem) => {
let newElem = Reducer_Expression_Lambda.doLambdaCall(
Belt.Array.map(array, elem =>
Reducer_Expression_Lambda.doLambdaCall(
eLambdaValue,
list{elem},
(accessors: ProjectAccessorsT.t),
(reducer: ProjectReducerFnT.t),
)
list{newElem, ...acc}
})
mappedList->Belt.List.toArray->Wrappers.evArray
)->Wrappers.evArray
}
let reduce = (