mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-09 18:00:33 +08:00
Make RawGroupInfo.parseBy not inline
This commit is contained in:
parent
43cb22e023
commit
6725a9d524
@ -52,9 +52,8 @@ internal data class RawGroupInfo(
|
|||||||
val members: Map<UInt, MemberPermission>
|
val members: Map<UInt, MemberPermission>
|
||||||
) : GroupPacket.InfoResponse {
|
) : GroupPacket.InfoResponse {
|
||||||
|
|
||||||
@Suppress("NOTHING_TO_INLINE") // this function it only executed in one place.
|
|
||||||
@UseExperimental(MiraiInternalAPI::class)
|
@UseExperimental(MiraiInternalAPI::class)
|
||||||
inline fun parseBy(group: Group): GroupInfo = group.bot.withSession {
|
fun parseBy(group: Group): GroupInfo = group.bot.withSession {
|
||||||
val memberList = LockFreeLinkedList<Member>()
|
val memberList = LockFreeLinkedList<Member>()
|
||||||
members.forEach { entry: Map.Entry<UInt, MemberPermission> ->
|
members.forEach { entry: Map.Entry<UInt, MemberPermission> ->
|
||||||
entry.key.qq().let { group.Member(it, entry.value, it.coroutineContext) }
|
entry.key.qq().let { group.Member(it, entry.value, it.coroutineContext) }
|
||||||
@ -191,7 +190,7 @@ internal object GroupPacket : SessionPacketFactory<GroupPacket.GroupPacketRespon
|
|||||||
0x72u -> {
|
0x72u -> {
|
||||||
when (val flag = readByte().toInt()) {
|
when (val flag = readByte().toInt()) {
|
||||||
0x02 -> GroupNotFound
|
0x02 -> GroupNotFound
|
||||||
0x00 -> {
|
0x00 -> debugPrintIfFail("解析群信息") {
|
||||||
discardExact(4) // group internal id
|
discardExact(4) // group internal id
|
||||||
val group = readUInt() // group id
|
val group = readUInt() // group id
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user