Revert "Fix incompatibilities with Kotlin 1.5.0"

This reverts commit b8ca1157ab6d463a19f6a7bbfeb25d1f9f1be911.

Reason for revert: b/187908823

Change-Id: I9606c5730f4e8697a9319939acda0a9b7a74634d
This commit is contained in:
Aurimas Liutikas 2021-05-12 21:56:31 +00:00
parent b8ca1157ab
commit c5b4071877
3 changed files with 4 additions and 4 deletions

View File

@ -114,7 +114,7 @@ class ControlsUiControllerImpl @Inject constructor (
private val onSeedingComplete = Consumer<Boolean> {
accepted ->
if (accepted) {
selectedStructure = controlsController.get().getFavorites().maxByOrNull {
selectedStructure = controlsController.get().getFavorites().maxBy {
it.controls.size
} ?: EMPTY_STRUCTURE
updatePreferences(selectedStructure)

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.minOrNull() })) // Sort by "smallest" AppOpp (Location is largest)
{ it.second.min() })) // Sort by "smallest" AppOpp (Location is largest)
types = itemsList.map { it.privacyType }.distinct().sorted()
}

View File

@ -43,8 +43,8 @@ inline infix fun Int.times(action: () -> Unit) {
* cccc dd
*/
fun Iterable<Pair<String, String>>.columnize(separator: String = " | "): String {
val col1w = map { (a, _) -> a.length }.maxOrNull()!!
val col2w = map { (_, b) -> b.length }.maxOrNull()!!
val col1w = map { (a, _) -> a.length }.max()!!
val col2w = map { (_, b) -> b.length }.max()!!
return map { it.first.padEnd(col1w) + separator + it.second.padEnd(col2w) }.joinToString("\n")
}