فهرست منبع

effective function name

Him188 6 سال پیش
والد
کامیت
b9129576bb

+ 1 - 1
mirai-demos/mirai-demo-gentleman/src/main/kotlin/demo/gentleman/Gentleman.kt

@@ -18,7 +18,7 @@ private const val IMAGE_BUFFER_CAPACITY: Int = 5
 @ExperimentalUnsignedTypes
 @ExperimentalCoroutinesApi
 object Gentlemen : MutableMap<UInt, Gentleman> by mutableMapOf() {
-    fun getOrPut(key: Contact): Gentleman = this.getOrPut(key.id) { Gentleman(key) }
+    fun provide(key: Contact): Gentleman = this.getOrPut(key.id) { Gentleman(key) }
 }
 
 /**

+ 1 - 1
mirai-demos/mirai-demo-gentleman/src/main/kotlin/demo/gentleman/Main.kt

@@ -43,7 +43,7 @@ suspend fun main() {
                 try {
                     repeat(it.toIntOrNull() ?: 1) {
                         launch {
-                            Gentlemen.getOrPut(subject).receive().image.await().send()
+                            Gentlemen.provide(subject).receive().image.await().send()
                         }
                     }
                 } catch (e: Exception) {