From de77ee6d63eed93973444dd168e84d07bcbc3b8c Mon Sep 17 00:00:00 2001 From: Ilya Gorbunov Date: Sat, 31 Oct 2015 04:03:44 +0300 Subject: [PATCH] Replace deprecated join with joinToString in idl2k --- libraries/tools/idl2k/src/main/kotlin/render.kt | 2 +- libraries/tools/idl2k/src/main/kotlin/types.kt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libraries/tools/idl2k/src/main/kotlin/render.kt b/libraries/tools/idl2k/src/main/kotlin/render.kt index 0e792d5c202..eefb8e9b26f 100644 --- a/libraries/tools/idl2k/src/main/kotlin/render.kt +++ b/libraries/tools/idl2k/src/main/kotlin/render.kt @@ -65,7 +65,7 @@ private fun Appendable.renderArgumentsDeclaration(args: List, } }.joinTo(this, ", ", "(", ")") -private fun renderCall(call: GenerateFunctionCall) = "${call.name.replaceKeywords()}(${call.arguments.map { it.replaceKeywords() }.join(", ")})" +private fun renderCall(call: GenerateFunctionCall) = "${call.name.replaceKeywords()}(${call.arguments.joinToString(", ") { it.replaceKeywords() }})" private fun Appendable.renderFunctionDeclaration(f: GenerateFunction, override: Boolean, commented: Boolean, level: Int = 1) { indent(commented, level) diff --git a/libraries/tools/idl2k/src/main/kotlin/types.kt b/libraries/tools/idl2k/src/main/kotlin/types.kt index bda1b1f6f16..b61d324a08d 100644 --- a/libraries/tools/idl2k/src/main/kotlin/types.kt +++ b/libraries/tools/idl2k/src/main/kotlin/types.kt @@ -29,7 +29,7 @@ data class SimpleType(val type: String, override val nullable: Boolean) : Type { } data class FunctionType(val parameterTypes : List, val returnType : Type, override val nullable: Boolean) : Type { override fun render() = if (nullable) "(${renderImpl()})?" else renderImpl() - private fun renderImpl() = "(${parameterTypes.map { it.type.render() }.join(", ")}) -> ${returnType.render()}" + private fun renderImpl() = "(${parameterTypes.joinToString(", ") { it.type.render() }}) -> ${returnType.render()}" } val FunctionType.arity : Int @@ -42,7 +42,7 @@ class UnionType(val namespace: String, types: Collection, override val nul operator fun contains(type: Type) = type in memberTypes override fun equals(other: Any?): Boolean = other is UnionType && memberTypes == other.memberTypes override fun hashCode(): Int = memberTypes.hashCode() - override fun toString(): String = memberTypes.map { it.toString() }.join(", ", "Union<", ">") + override fun toString(): String = memberTypes.joinToString(", ", "Union<", ">") override fun render(): String = name.appendNullabilitySuffix(this)