From bc843d67b455e484cd05cdf28e5ce5dec68119d4 Mon Sep 17 00:00:00 2001 From: Paweł Marks Date: Thu, 9 Apr 2020 13:27:30 +0200 Subject: Fix improper reporting of time measurement --- core/src/main/kotlin/DokkaGenerator.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'core') diff --git a/core/src/main/kotlin/DokkaGenerator.kt b/core/src/main/kotlin/DokkaGenerator.kt index 72161322..9616b013 100644 --- a/core/src/main/kotlin/DokkaGenerator.kt +++ b/core/src/main/kotlin/DokkaGenerator.kt @@ -201,10 +201,12 @@ private class Timer(startTime: Long, private val logger: DokkaLogger?) { val namePad = steps.map { it.first.length }.max() ?: 0 val timePad = steps.windowed(2).map { (p1, p2) -> p2.second - p1.second }.max()?.toString()?.length ?: 0 steps.windowed(2).forEach { (p1, p2) -> - println("${p2.first.padStart(namePad)}: ${(p2.second - p1.second).toString().padStart(timePad)}") + if (p1.first.isNotBlank()) { + println("${p1.first.padStart(namePad)}: ${(p2.second - p1.second).toString().padStart(timePad)}") + } } } } private fun timed(logger: DokkaLogger? = null, block: Timer.() -> Unit): Timer = - Timer(System.currentTimeMillis(), logger).apply(block) \ No newline at end of file + Timer(System.currentTimeMillis(), logger).apply(block).apply { report("") } \ No newline at end of file -- cgit