From ec75aaed634275e67103517b2a4565f8aef927f9 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Sat, 28 May 2022 07:23:26 +0000 Subject: [PATCH] Replace ternary syntax with if expression --- service/wish.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/service/wish.py b/service/wish.py index 72f9512e..37d86179 100644 --- a/service/wish.py +++ b/service/wish.py @@ -67,7 +67,7 @@ def get_is_up(rank: int, count: WishCountInfo, gacha_type: GACHA_TYPE): def get_rank(count: WishCountInfo, gacha_type: GACHA_TYPE): value = random_int() - probability_fn = is_character_gacha(gacha_type) and character_probability or weapon_probability + probability_fn = character_probability if is_character_gacha(gacha_type) else weapon_probability index_5 = probability_fn(5, count.five_stars_count) index_4 = probability_fn(4, count.four_stars_count) + index_5 if value <= index_5: