Skip to content

Commit

Permalink
Improve perf
Browse files Browse the repository at this point in the history
  • Loading branch information
gcamp committed Aug 31, 2018
1 parent 717e69a commit a096a42
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions helpers/import.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,10 @@ function processRows(gtfs, tableName, indexKeys, rows, shouldThrow) {
const arrayOfValues = fromCsvStringToArray(row, tableName, gtfs).map(key => key.trim());

if (arrayOfValues !== null) {
const item = sortedKeys.reduce((accumulator, key, i) => {
accumulator[key] = arrayOfValues[i];
return accumulator;
}, {});
const item = {};
for (let i = 0; i < sortedKeys.length; i += 1) {
item[sortedKeys[i]] = arrayOfValues[i];
}

if (sortedKeys.length !== arrayOfValues.length) {
if (shouldThrow === true) {
Expand Down

0 comments on commit a096a42

Please sign in to comment.