Skip to content

Commit

Permalink
refactor(model): Inline the misleading Project.managerName property
Browse files Browse the repository at this point in the history
Avoid the impression that the package manager's name would always match
the type of a project's identifier.

Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
  • Loading branch information
sschuberth committed Sep 5, 2024
1 parent 7c52615 commit dabcd27
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions model/src/main/kotlin/DependencyGraphNavigator.kt
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ class DependencyGraphNavigator(
override fun scopeNames(project: Project): Set<String> = project.scopeNames.orEmpty()

override fun directDependencies(project: Project, scopeName: String): Sequence<DependencyNode> {
val graph = graphForManager(project.managerName)
val graph = graphForManager(project.id.type)
val rootDependencies = graph.scopes[DependencyGraph.qualifyScope(project, scopeName)].orEmpty().map { root ->
referenceFor(project.managerName, root)
referenceFor(project.id.type, root)
}

return dependenciesSequence(graph, rootDependencies)
Expand Down Expand Up @@ -187,13 +187,6 @@ private class DependencyRefCursor(
override fun hashCode(): Int = current.hashCode()
}

/**
* Return the name of the package manager that constructed this [Project]. This is required to find the
* [DependencyGraph] for this project.
*/
private val Project.managerName: String
get() = id.type

/**
* Construct a data structure that allows fast access to all [DependencyGraphNode]s contained in this
* [DependencyGraph] based on its index and fragment. This structure is used to lookup specific nodes, typically
Expand Down

0 comments on commit dabcd27

Please sign in to comment.