From 63a1d46492be2fd7b0eb1f59f25f4dc4f90e5afa Mon Sep 17 00:00:00 2001 From: theEvilReaper Date: Sun, 26 May 2024 22:38:23 +0200 Subject: [PATCH] Improve separator determination --- .../net/theevilreaper/dartpoet/extension/ExtensionSpec.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/net/theevilreaper/dartpoet/extension/ExtensionSpec.kt b/src/main/kotlin/net/theevilreaper/dartpoet/extension/ExtensionSpec.kt index cae61f63..c2f23ed0 100644 --- a/src/main/kotlin/net/theevilreaper/dartpoet/extension/ExtensionSpec.kt +++ b/src/main/kotlin/net/theevilreaper/dartpoet/extension/ExtensionSpec.kt @@ -37,7 +37,11 @@ class ExtensionSpec internal constructor( internal val joinedRawTypes by lazy { if (genericType.isEmpty()) return@lazy EMPTY_STRING val withComma = genericType.size > 1 - genericType.joinToString(if (withComma) ", " else EMPTY_STRING) { it.getRawData() } + val separator = when (withComma) { + true -> ", " + false -> EMPTY_STRING + } + genericType.joinToString(separator) { it.getRawData() } } /**