Commit be63ec48 authored by Him188's avatar Him188

Review: misc improvements

parent 48a2d9ca
buildscript {
repositories {
mavenLocal()
maven { url "https://mirrors.huaweicloud.com/repository/maven" }
maven { url 'https://mirrors.huaweicloud.com/repository/maven' }
jcenter()
mavenCentral()
google()
maven { url "https://dl.bintray.com/kotlin/kotlin-eap" }
maven { url 'https://dl.bintray.com/kotlin/kotlin-dev/'}
maven { url 'https://dl.bintray.com/kotlin/kotlin-eap' }
maven { url 'https://dl.bintray.com/kotlin/kotlin-dev' }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
classpath("com.github.jengelman.gradle.plugins:shadow:5.2.0")
classpath 'com.github.jengelman.gradle.plugins:shadow:5.2.0'
classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlinVersion"
classpath "org.jetbrains.kotlinx:atomicfu-gradle-plugin:$atomicFuVersion"
}
......@@ -27,7 +27,9 @@ try {
} else {
project.ext.set("isAndroidSDKAvailable", false)
}
}catch(Exception e){}
} catch (Exception ignored) {
}
allprojects {
group = "net.mamoe"
version = getProperty("mirai_version")
......
......@@ -75,11 +75,11 @@ internal abstract class QQAndroidBotBase constructor(
// internally visible only
fun getGroupByUin(uin: Long): Group {
return groups.delegate.filteringGetOrNull { (it as GroupImpl).uin == uin } ?: throw NoSuchElementException("Can not found group with ID=${uin}")
return groups.delegate.getOrNull(uin) ?: throw NoSuchElementException("Can not found group with ID=${uin}")
}
fun getGroupByUinOrNull(uin: Long): Group? {
return groups.delegate.filteringGetOrNull { (it as GroupImpl).uin == uin }
return groups.delegate.getOrNull(uin)
}
override suspend fun queryGroupList(): Sequence<Long> {
......
......@@ -16,6 +16,8 @@ import net.mamoe.mirai.utils.*
/**
* 只读联系人列表, lock-free 实现
*
* @see ContactList.asSequence
*/
@UseExperimental(MiraiInternalAPI::class)
@Suppress("unused")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment