#KT-1675 Fixed, renaming join() -> makeString() and adding an appendString() which reduces the possible number of appendables being created
This commit is contained in:
@@ -766,7 +766,7 @@ class KPackage(model: KModel, val descriptor: NamespaceDescriptor,
|
||||
/** Returns a relative path like ../.. for each path in the name */
|
||||
public val nameAsRelativePath: String
|
||||
get() {
|
||||
val answer = namePaths.map{ ".." }.join("/")
|
||||
val answer = namePaths.map{ ".." }.makeString("/")
|
||||
return if (answer.length == 0) "" else answer + "/"
|
||||
}
|
||||
|
||||
@@ -922,7 +922,7 @@ class KFunction(val descriptor: CallableDescriptor, val owner: KClassOrPackage,
|
||||
var annotations: List<KAnnotation> = arrayList<KAnnotation>(),
|
||||
var sourceLine: Int = 2): KAnnotated(owner.model, descriptor), Comparable<KFunction> {
|
||||
|
||||
public val parameterTypeText: String = parameters.map{ it.aType.name }.join(", ")
|
||||
public val parameterTypeText: String = parameters.map{ it.aType.name }.makeString(", ")
|
||||
|
||||
override fun compareTo(other: KFunction): Int {
|
||||
var answer = name.compareTo(other.name)
|
||||
@@ -946,7 +946,7 @@ class KFunction(val descriptor: CallableDescriptor, val owner: KClassOrPackage,
|
||||
|
||||
/** Returns a list of generic type parameter names kinds like "A, I" */
|
||||
public val typeParametersText: String
|
||||
get() = typeParameters.map{ it.name }.join(", ")
|
||||
get() = typeParameters.map{ it.name }.makeString(", ")
|
||||
}
|
||||
|
||||
class KProperty(val owner: KClassOrPackage, val descriptor: PropertyDescriptor, val name: String,
|
||||
|
||||
+1
-1
@@ -113,7 +113,7 @@ abstract class KDocTemplate() : TextTemplate() {
|
||||
}
|
||||
|
||||
open fun typeArguments(arguments: List<KType>, val prefix: String = "<", val postfix: String = ">", val empty: String = ""): String {
|
||||
val text = arguments.map<KType, String>() { link(it) }.join(", ")
|
||||
val text = arguments.map<KType, String>() { link(it) }.makeString(", ")
|
||||
return if (text.length() == 0) empty else "$prefix$text$postfix"
|
||||
}
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -124,7 +124,7 @@ abstract class PackageTemplateSupport(open val pkg: KPackage) : KDocTemplate() {
|
||||
println("""<PRE>""")
|
||||
println("""<FONT SIZE="-1">""")
|
||||
printAnnotations(function.annotations)
|
||||
print("""</FONT>${function.modifiers.join(" ")} $funKeyword""")
|
||||
print("""</FONT>${function.modifiers.makeString(" ")} $funKeyword""")
|
||||
|
||||
printTypeParameters(function, " ")
|
||||
printReceiverType(function, " ", ".", " ")
|
||||
|
||||
Reference in New Issue
Block a user