Skip to content

Commit 2f4482e

Browse files
committed
for loop instead of forEach
1 parent 9ce4d26 commit 2f4482e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/execution/execute.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1100,13 +1100,13 @@ function flattenEPRs(
11001100
): ExecutionPartialResultNP<mixed> {
11011101
const errors = [];
11021102
const data = [];
1103-
forEach((eprs: any), item => {
1104-
data.push(item[0]);
1105-
if (item[1] && item[1].length) {
1106-
errors.push(...item[1]);
1103+
for (let i = eprs.length - 1; i >= 0; i--) {
1104+
data[i] = eprs[i][0];
1105+
if (eprs[i][1] && eprs[i][1].length) {
1106+
errors.push(...eprs[i][1]);
11071107
}
1108-
});
1109-
return [data, errors.length ? errors : null];
1108+
}
1109+
return [data, errors.length ? errors.reverse() : null];
11101110
}
11111111

11121112
/**

0 commit comments

Comments
 (0)