Skip to content

Commit

Permalink
Merge pull request #1293 from nextstrain/filter-call-stack-size
Browse files Browse the repository at this point in the history
controls/filter: Avoid spread syntax with potentially large arrays
  • Loading branch information
jameshadfield authored Feb 26, 2021
2 parents 71365f2 + 7f0787a commit f4fa3fd
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/components/controls/filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,14 @@ class FilterData extends React.Component {
});
});
if (genotypeSymbol in this.props.activeFilters) {
const sortedGenotypes = [...collectGenotypeStates(this.props.nodes)].sort();
options.push(...sortedGenotypes.map((o) => ({
label: `genotype ${o}`,
value: [genotypeSymbol, o]
})));
Array.from(collectGenotypeStates(this.props.nodes))
.sort()
.forEach((o) => {
options.push({
label: `genotype ${o}`,
value: [genotypeSymbol, o]
});
});
}
if (strainSymbol in this.props.activeFilters) {
this.props.nodes
Expand Down

0 comments on commit f4fa3fd

Please sign in to comment.