Skip to content

Commit 0dc4d51

Browse files
committed
for loop instead of forEach
1 parent 8a3a34a commit 0dc4d51

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
@@ -1095,13 +1095,13 @@ function flattenEPRs(
10951095
): ExecutionPartialResultNP<mixed> {
10961096
const errors = [];
10971097
const data = [];
1098-
forEach((eprs: any), item => {
1099-
data.push(item[0]);
1100-
if (item[1] && item[1].length) {
1101-
errors.push(...item[1]);
1098+
for (let i = eprs.length - 1; i >= 0; i--) {
1099+
data[i] = eprs[i][0];
1100+
if (eprs[i][1] && eprs[i][1].length) {
1101+
errors.push(...eprs[i][1]);
11021102
}
1103-
});
1104-
return [data, errors.length ? errors : null];
1103+
}
1104+
return [data, errors.length ? errors.reverse() : null];
11051105
}
11061106

11071107
/**

0 commit comments

Comments
 (0)