[JVM] Micro-optimize method signature mapping
This commit optimizes functions related to method signature mapping on the JVM backend. The most significant change is avoiding re-allocations in StringBuilder when building internal names. The commit also includes minor optimizations, such as removing redundant allocations of strings and other objects.
This commit is contained in:
committed by
Space Team
parent
70996035fc
commit
059046a2b1
@@ -109,7 +109,10 @@ fun String.capitalizeAsciiOnly(): String {
|
||||
if (isEmpty()) return this
|
||||
val c = this[0]
|
||||
return if (c in 'a'..'z')
|
||||
c.uppercaseChar() + substring(1)
|
||||
buildString(length) {
|
||||
append(c.uppercaseChar())
|
||||
append(this@capitalizeAsciiOnly, 1, this@capitalizeAsciiOnly.length)
|
||||
}
|
||||
else
|
||||
this
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user