Skip to content

Commit

Permalink
Use a Set for id lookup (#1088)
Browse files Browse the repository at this point in the history
  • Loading branch information
dmfalke authored May 21, 2024
1 parent b2458f0 commit 7e97ee8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -534,13 +534,13 @@ function isEnabledInPicker({

// Find all variables in any collection, then remove them from the
// list of all variables to get a list of metadata variables.
const variablesInACollection = entities[0].collections?.flatMap(
(collection) => {
const variablesInACollection = new Set(
entities[0].collections?.flatMap((collection) => {
return collection.memberVariableIds;
}
})
);
metadataVariables = entities[0].variables.filter((variable) => {
return !variablesInACollection?.includes(variable.id);
return !variablesInACollection.has(variable.id);
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -411,13 +411,13 @@ function isEnabledInPicker({

// Find all variables in any collection, then remove them from the
// list of all variables to get a list of metadata variables.
const variablesInACollection = entities[0].collections?.flatMap(
(collection) => {
const variablesInACollection = new Set(
entities[0].collections?.flatMap((collection) => {
return collection.memberVariableIds;
}
})
);
metadataVariables = entities[0].variables.filter((variable) => {
return !variablesInACollection?.includes(variable.id);
return !variablesInACollection.has(variable.id);
});
}

Expand Down

0 comments on commit 7e97ee8

Please sign in to comment.