faster filter
This commit is contained in:
parent
4d1f76f80e
commit
1187c0330a
|
@ -73,19 +73,18 @@ module Internals = {
|
||||||
accessors: ProjectAccessorsT.t,
|
accessors: ProjectAccessorsT.t,
|
||||||
reducer: ProjectReducerFnT.t,
|
reducer: ProjectReducerFnT.t,
|
||||||
) => {
|
) => {
|
||||||
let mappedList = aValueArray->Belt.Array.reduceReverse(list{}, (acc, elem) => {
|
Js.Array2.filter(aValueArray, elem => {
|
||||||
let newElem = Reducer_Expression_Lambda.doLambdaCall(
|
let result = Reducer_Expression_Lambda.doLambdaCall(
|
||||||
aLambdaValue,
|
aLambdaValue,
|
||||||
list{elem},
|
list{elem},
|
||||||
accessors,
|
accessors,
|
||||||
reducer,
|
reducer,
|
||||||
)
|
)
|
||||||
switch newElem {
|
switch result {
|
||||||
| IEvBool(true) => list{elem, ...acc}
|
| IEvBool(true) => true
|
||||||
| _ => acc
|
| _ => false
|
||||||
}
|
}
|
||||||
})
|
})->Wrappers.evArray
|
||||||
mappedList->Belt.List.toArray->Wrappers.evArray
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user