Merge "Fix Kotlin warning (min -> minOrNull)"

This commit is contained in:
Fabian Kozynski
2021-01-15 17:41:33 +00:00
committed by Android (Google) Code Review

View File

@@ -28,7 +28,7 @@ class PrivacyChipBuilder(private val context: Context, itemsList: List<PrivacyIt
appsAndTypes = itemsList.groupBy({ it.application }, { it.privacyType })
.toList()
.sortedWith(compareBy({ -it.second.size }, // Sort by number of AppOps
{ it.second.min() })) // Sort by "smallest" AppOpp (Location is largest)
{ it.second.minOrNull() })) // Sort by "smallest" AppOpp (Location is largest)
types = itemsList.map { it.privacyType }.distinct().sorted()
}