diff options
author | Aurimas Liutikas <aurimas@google.com> | 2021-05-12 23:37:59 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2021-05-12 23:37:59 +0000 |
commit | 2f7dfa04bf98d862fc7a0a7fd81f19d1f66d7eec (patch) | |
tree | c46c4554991f543a715def82541c27f3db50e393 | |
parent | d4f9f8516993731b88bdf62448dd9d3e489e5ee4 (diff) | |
parent | 6d2c711220d72620090941cf14ac33037d402523 (diff) | |
download | trebuchet-2f7dfa04bf98d862fc7a0a7fd81f19d1f66d7eec.tar.gz |
Revert "Fix usage of minBy to unblock Kotlin 1.5 upgrade" am: 375f839d08 am: 096f1a5ab5 am: f4b3ef341e am: 6d2c711220
Original change: https://android-review.googlesource.com/c/platform/tools/trebuchet/+/1705634
Change-Id: If2d9eaf01edcebf811cc17df4c4ea771df6ad8f7
-rw-r--r-- | core/common/src/main/kotlin/trebuchet/queries/SliceQueries.kt | 2 | ||||
-rw-r--r-- | 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<Slice> { * @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<StartupEvent> { 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<SchedulingState, Double> = mutableMapOf() newProc.threads.first().schedSlices.forEach schedLoop@ { schedSlice -> |