[O] Use Iterable<T>.mapApply()

This commit is contained in:
Menci
2025-12-10 23:43:51 +08:00
committed by Azalea
parent f23c0d6fe1
commit be5220fd51

View File

@@ -2,6 +2,7 @@ package icu.samnyan.aqua.sega.maimai2.handler
import ext.int
import ext.logger
import ext.mapApply
import icu.samnyan.aqua.net.games.mai2.Maimai2
import icu.samnyan.aqua.sega.general.BaseHandler
import icu.samnyan.aqua.sega.general.dao.CardRepository
@@ -31,7 +32,7 @@ class GetUserCharacterHandler(
charaIds.associateWith { Mai2UserCharacter().apply { characterId = it; level = 1 } } +
it.associateBy { it.characterId }
).values }
.let { if (gameOptions?.mai2UnlockCharaMaxLevel != true) it else it.map { it.apply { level = 9999 } } }
.let { if (gameOptions?.mai2UnlockCharaMaxLevel != true) it else it.mapApply { level = 9999 } }
return mapOf(
"userId" to userId,