mirror of
https://github.com/PaiGramTeam/PaiGram.git
synced 2024-11-16 12:51:35 +00:00
⚡ 为抽卡模拟器添加缓存
This commit is contained in:
parent
6a2096d1ea
commit
8c9a13c61f
@ -103,12 +103,14 @@ def game_id_to_role_id(gid: str) -> int | None:
|
||||
)
|
||||
|
||||
|
||||
@functools.lru_cache()
|
||||
def weapon_to_game_id(name: str) -> Optional[int]:
|
||||
return next(
|
||||
(int(key) for key, value in WEAPON_DATA.items() if value['name'] == name), None
|
||||
)
|
||||
|
||||
|
||||
@functools.lru_cache()
|
||||
def avatar_to_game_id(name: str) -> Optional[int]:
|
||||
return next(
|
||||
(int(key) for key, value in AVATAR_DATA.items() if value['name'] == name), None
|
||||
|
Loading…
Reference in New Issue
Block a user