Skip to content

Commit

Permalink
chore(yarn2): Map directly to a set
Browse files Browse the repository at this point in the history
Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
  • Loading branch information
sschuberth committed Nov 14, 2024
1 parent 959b3af commit 92fdfa2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions plugins/package-managers/node/src/main/kotlin/yarn2/Yarn2.kt
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ class Yarn2(
.forEach { (dependencyType, allScopedDependencies) ->
allProjects.values.forEach { project ->
val dependencies = allScopedDependencies[project.id]
val dependenciesInfo = dependencies?.mapNotNull { dependency ->
val dependenciesInfo = dependencies?.mapNotNullTo(mutableSetOf()) { dependency ->
if ("Yarn2" in dependency.type) {
val projectAsDependency = allProjects.entries.find { entry ->
entry.key.type == "Yarn2" && entry.key.name == dependency.name &&
Expand Down Expand Up @@ -360,7 +360,7 @@ class Yarn2(
)
}
}
}?.toSet().orEmpty()
}.orEmpty()

graphBuilder.addDependencies(project.id, dependencyType.type, dependenciesInfo)
}
Expand Down

0 comments on commit 92fdfa2

Please sign in to comment.