Skip to content

Commit

Permalink
chore(core): cleanup some code in find-matching-projects (#16523)
Browse files Browse the repository at this point in the history
  • Loading branch information
AgentEnder authored Apr 24, 2023
1 parent eb47747 commit 5d8839a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions packages/nx/src/utils/find-matching-projects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,18 @@ export function findMatchingProjects(
// Same thing as `type:unlabeled`. If no specific type is set,
// we can waterfall through the different types until we find a match
default: {
const size = selectedProjects.size + excludedProjects.size;
// The size of the selected and excluded projects set, before we
// start updating it with this pattern. If the size changes, we
// know we found a match and can skip the other types.
const originalSize = selectedProjects.size + excludedProjects.size;
addMatchingProjectsByName(
projectNames,
projects,
pattern,
excludedProjects,
selectedProjects
);
if (selectedProjects.size + excludedProjects.size > size) {
if (selectedProjects.size + excludedProjects.size > originalSize) {
// There was some match by name, don't check other types
continue;
}
Expand All @@ -109,7 +112,7 @@ export function findMatchingProjects(
excludedProjects,
selectedProjects
);
if (selectedProjects.size + excludedProjects.size > size) {
if (selectedProjects.size + excludedProjects.size > originalSize) {
// There was some match by directory, don't check other types
// Note - this doesn't do anything currently, but preps for future
// types
Expand Down

1 comment on commit 5d8839a

@vercel
Copy link

@vercel vercel bot commented on 5d8839a Apr 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

nx-dev – ./

nx-dev-nrwl.vercel.app
nx-dev-git-master-nrwl.vercel.app
nx.dev
nx-five.vercel.app

Please sign in to comment.