File tree 2 files changed +3
-2
lines changed
commonMain/src/kotlinx/benchmark
nativeMain/src/kotlinx/benchmark/native
2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ internal object TextBenchmarkReportFormatter : BenchmarkReportFormatter() {
21
21
22
22
override fun format (results : Collection <ReportBenchmarkResult >): String {
23
23
fun columnLength (column : String , selector : (ReportBenchmarkResult ) -> String ): Int =
24
- max(column.length, results.maxOf { selector(it).length })
24
+ max(column.length, results.maxOfOrNull { selector(it).length } ? : 0 )
25
25
26
26
val shortNames = denseBenchmarkNames(results.map { it.benchmark.name })
27
27
val nameLength = columnLength(" Benchmark" ) { shortNames[it.benchmark.name]!! }
Original file line number Diff line number Diff line change @@ -172,7 +172,8 @@ class NativeExecutor(
172
172
}
173
173
174
174
private fun storeResults (benchmarks : List <BenchmarkDescriptor <Any ?>>, complete : () -> Unit ) {
175
- additionalArguments[0 ].readFile().lines().forEach {
175
+ val resultsContent = additionalArguments[0 ].readFile()
176
+ resultsContent.takeIf (String ::isNotEmpty)?.lines()?.forEach {
176
177
val (configFileName, samplesList) = it.split(" : " )
177
178
val samples = samplesList.split(" , " ).map { it.toDouble() }.toDoubleArray()
178
179
val benchmarkRun = configFileName.parseBenchmarkConfig()
You can’t perform that action at this time.
0 commit comments