Skip to content

Commit

Permalink
chore(package-managers): Simplify some set constructions
Browse files Browse the repository at this point in the history
Signed-off-by: Sebastian Schuberth <[email protected]>
  • Loading branch information
sschuberth committed Feb 23, 2024
1 parent 5d12d9b commit e62e68b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ class CocoaPods(
return Package(
id = id,
authors = emptySet(),
declaredLicenses = podspec.license.takeUnless { it.isEmpty() }?.let { setOf(it) }.orEmpty(),
declaredLicenses = setOfNotNull(podspec.license.takeUnless { it.isEmpty() }),
description = podspec.summary,
homepageUrl = podspec.homepage,
binaryArtifact = RemoteArtifact.EMPTY,
Expand Down
2 changes: 1 addition & 1 deletion plugins/package-managers/conan/src/main/kotlin/Conan.kt
Original file line number Diff line number Diff line change
Expand Up @@ -488,5 +488,5 @@ class Conan(
* author name; otherwise, return an empty set.
*/
private fun parseAuthors(node: JsonNode): Set<String> =
parseAuthorString(node["author"]?.textValue(), '<', '(')?.let { setOf(it) }.orEmpty()
setOfNotNull(parseAuthorString(node["author"]?.textValue(), '<', '('))
}
2 changes: 1 addition & 1 deletion plugins/package-managers/stack/src/main/kotlin/Stack.kt
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ class Stack(
.map(String::trim)
.filter(String::isNotEmpty)
.mapNotNullTo(mutableSetOf(), ::parseAuthorString),
declaredLicenses = map["license"]?.let { setOf(it) }.orEmpty(),
declaredLicenses = setOfNotNull(map["license"]),
description = map["description"].orEmpty(),
homepageUrl = homepageUrl,
binaryArtifact = RemoteArtifact.EMPTY,
Expand Down

0 comments on commit e62e68b

Please sign in to comment.