slightly faster map implementation
see this comment: https://github.com/quantified-uncertainty/squiggle/pull/1047#issuecomment-1241805927
This commit is contained in:
parent
ecc82ba8f7
commit
4d1f76f80e
|
@ -33,16 +33,14 @@ module Internals = {
|
||||||
eLambdaValue,
|
eLambdaValue,
|
||||||
reducer: ProjectReducerFnT.t,
|
reducer: ProjectReducerFnT.t,
|
||||||
): ReducerInterface_InternalExpressionValue.t => {
|
): ReducerInterface_InternalExpressionValue.t => {
|
||||||
let mappedList = array->E.A.reduceReverse(list{}, (acc, elem) => {
|
Belt.Array.map(array, elem =>
|
||||||
let newElem = Reducer_Expression_Lambda.doLambdaCall(
|
Reducer_Expression_Lambda.doLambdaCall(
|
||||||
eLambdaValue,
|
eLambdaValue,
|
||||||
list{elem},
|
list{elem},
|
||||||
(accessors: ProjectAccessorsT.t),
|
(accessors: ProjectAccessorsT.t),
|
||||||
(reducer: ProjectReducerFnT.t),
|
(reducer: ProjectReducerFnT.t),
|
||||||
)
|
)
|
||||||
list{newElem, ...acc}
|
)->Wrappers.evArray
|
||||||
})
|
|
||||||
mappedList->Belt.List.toArray->Wrappers.evArray
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let reduce = (
|
let reduce = (
|
||||||
|
|
Loading…
Reference in New Issue
Block a user