From 375f839d08f42cde0da7d623a44d0d082610662d Mon Sep 17 00:00:00 2001 From: Aurimas Liutikas Date: Wed, 12 May 2021 21:56:38 +0000 Subject: Revert "Fix usage of minBy to unblock Kotlin 1.5 upgrade" This reverts commit 6e914b3fe586f61c24e5add5e903a375be94f756. Reason for revert: b/187908823 Change-Id: I12da9f0984d68b8335ff88c83b5a721c0922495d --- core/common/src/main/kotlin/trebuchet/queries/SliceQueries.kt | 2 +- trebuchet/startup-common/src/StartupCommon.kt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/common/src/main/kotlin/trebuchet/queries/SliceQueries.kt b/core/common/src/main/kotlin/trebuchet/queries/SliceQueries.kt index 00f9953..79a9183 100644 --- a/core/common/src/main/kotlin/trebuchet/queries/SliceQueries.kt +++ b/core/common/src/main/kotlin/trebuchet/queries/SliceQueries.kt @@ -113,7 +113,7 @@ fun ThreadModel.selectAll(predicate: (Slice) -> Boolean): List { * @param predicate The predicate used to test slices */ fun Model.selectFirst(predicate: (Slice) -> Boolean) : Slice? { - return this.processes.values.mapNotNull { it.selectFirst(predicate) }.minByOrNull { it.startTime } + return this.processes.values.mapNotNull { it.selectFirst(predicate) }.minBy { it.startTime } } diff --git a/trebuchet/startup-common/src/StartupCommon.kt b/trebuchet/startup-common/src/StartupCommon.kt index 2cf4793..75ed400 100644 --- a/trebuchet/startup-common/src/StartupCommon.kt +++ b/trebuchet/startup-common/src/StartupCommon.kt @@ -115,7 +115,7 @@ fun Model.findProcess(queryName: String, map { it.slices }. filter { it.isNotEmpty() }. map { it.first().startTime }. - minOrNull() ?: throw MissingProcessInfoException(process.id) + min() ?: throw MissingProcessInfoException(process.id) if (firstSliceStart in lowerBound..upperBound) { return process @@ -142,7 +142,7 @@ fun Model.getStartupEvents() : List { val newProc = this.findProcess(newProcName, systemServerSlice.startTime, systemServerSlice.endTime) val startProcSlice = systemServerProc.findFirstSlice(SLICE_NAME_PROC_START, newProcName, systemServerSlice.startTime, systemServerSlice.endTime) val rfdSlice = systemServerProc.findFirstSliceOrNull(SLICE_NAME_REPORT_FULLY_DRAWN, newProcName, systemServerSlice.startTime) - val firstSliceTime = newProc.threads.map { it.slices.firstOrNull()?.startTime ?: Double.POSITIVE_INFINITY }.minOrNull()!! + val firstSliceTime = newProc.threads.map { it.slices.firstOrNull()?.startTime ?: Double.POSITIVE_INFINITY }.min()!! val schedSliceInfo : MutableMap = mutableMapOf() newProc.threads.first().schedSlices.forEach schedLoop@ { schedSlice -> -- cgit v1.2.3