Skip to content

Commit

Permalink
refactor(bower): Simply use the package ID as key
Browse files Browse the repository at this point in the history
Signed-off-by: Frank Viernau <frank_viernau@epam.com>
  • Loading branch information
fviernau authored and sschuberth committed Jul 19, 2024
1 parent d9183dc commit 2c7c11f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions plugins/package-managers/bower/src/main/kotlin/Bower.kt
Original file line number Diff line number Diff line change
Expand Up @@ -143,13 +143,14 @@ private fun PackageInfo.toPackage() =
)

private fun parsePackages(info: PackageInfo): Set<Package> {
val result = mutableMapOf<String, Package>()
val result = mutableMapOf<Identifier, Package>()
val queue = LinkedList(info.dependencies.values)

while (queue.isNotEmpty()) {
val currentInfo = queue.removeFirst()

val pkg = currentInfo.toPackage()
result["${pkg.id.name}:${pkg.id.version}"] = pkg
result[pkg.id] = pkg

queue += info.dependencies.values
}
Expand Down

0 comments on commit 2c7c11f

Please sign in to comment.