From 6b09c5dfaeae4037c47e4030f6d2c278fc6cc987 Mon Sep 17 00:00:00 2001 From: Mikhail Glukhikh Date: Wed, 13 Jan 2016 19:51:57 +0300 Subject: [PATCH] Minor when missing cases renderer refactoring --- .../org/jetbrains/kotlin/diagnostics/rendering/Renderers.kt | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/rendering/Renderers.kt b/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/rendering/Renderers.kt index 11fa3a190b5..ba2f874e7d7 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/rendering/Renderers.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/rendering/Renderers.kt @@ -16,7 +16,6 @@ package org.jetbrains.kotlin.diagnostics.rendering -import com.google.common.base.Strings import com.google.common.collect.Lists import com.google.common.collect.Sets import com.intellij.openapi.diagnostic.Logger @@ -415,10 +414,9 @@ object Renderers { @JvmField val RENDER_WHEN_MISSING_CASES: Renderer> = Renderer { if (!it.hasUnknown) { - val list = it.take(WHEN_MISSING_LIMIT).map { "'$it'" }.joinToString(", ") + val list = it.joinToString(", ", limit = WHEN_MISSING_LIMIT) { "'$it'" } val branches = if (it.size > 1) "branches" else "branch" - val others = if (it.size > WHEN_MISSING_LIMIT) ", ..." else "" - "$list$others $branches or 'else' branch instead" + "$list $branches or 'else' branch instead" } else { "'else' branch"