Skip to content

Commit

Permalink
Remove concat() from ConditionValidationState.advance(), which greatl…
Browse files Browse the repository at this point in the history
…y increases performance in some cases
  • Loading branch information
sachindshinde committed Aug 7, 2024
1 parent cae9be3 commit b64653d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions query-graphs-js/src/conditionsValidation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class ConditionValidationState {
) {}

advance(supergraph: Schema): ConditionValidationState[] | null {
let newOptions: SimultaneousPathsWithLazyIndirectPaths[] = [];
const newOptions: SimultaneousPathsWithLazyIndirectPaths[] = [];
for (const paths of this.subgraphOptions) {
const pathsOptions = advanceSimultaneousPathsWithOperation(
supergraph,
Expand All @@ -40,7 +40,7 @@ class ConditionValidationState {
if (!pathsOptions) {
continue;
}
newOptions = newOptions.concat(pathsOptions);
newOptions.push(...pathsOptions);
}

// If we got no options, it means that particular selection of the conditions cannot be satisfied, so the
Expand Down

0 comments on commit b64653d

Please sign in to comment.