Skip to content

Commit

Permalink
Use imperative reduction function
Browse files Browse the repository at this point in the history
This is to forestall possible performance problems. See [this
comment](#644 (comment))
for details.
  • Loading branch information
waxlamp committed Aug 24, 2020
1 parent 53d8c61 commit 17f8fb8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions web/src/components/vis/analyses.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,10 @@ const analysisList = [
];

// Create a path-indexable map version of the analysis list.
const analysisMap = Object.freeze(analysisList.reduce((map, entry) => ({
...map,
[entry.path]: entry,
}), {}));
const analysisMap = Object.freeze(analysisList.reduce((map, entry) => {
map[entry.path] = entry;
return map;
}, {}));

export default analysisList;
export {
Expand Down

0 comments on commit 17f8fb8

Please sign in to comment.