mirror of
https://github.com/mamoe/mirai.git
synced 2025-04-14 23:20:49 +08:00
[core] Optimize array expansions
This commit is contained in:
parent
7cbff5a8c2
commit
f24ca9628f
mirai-core-utils/src/commonMain/kotlin
mirai-core/src/commonMain/kotlin/network/protocol/packet/chat/image
@ -55,4 +55,4 @@ public fun getRandomString(length: Int, vararg charRanges: CharRange, random: Ra
|
||||
|
||||
|
||||
public fun getRandomIntString(length: Int, random: Random = Random): String =
|
||||
getRandomString(length, *intCharRanges, random = random)
|
||||
getRandomString(length, charRanges = intCharRanges, random = random)
|
@ -22,7 +22,7 @@ import kotlin.random.Random
|
||||
import kotlin.random.nextInt
|
||||
|
||||
internal fun getRandomString(length: Int): String =
|
||||
getRandomString(length, *defaultRanges)
|
||||
getRandomString(length, charRanges = defaultRanges)
|
||||
|
||||
private val defaultRanges: Array<CharRange> = arrayOf('a'..'z', 'A'..'Z', '0'..'9')
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user