Replace ternary syntax with if expression

This commit is contained in:
deepsource-autofix[bot] 2022-05-28 07:23:26 +00:00 committed by 洛水.山岭居室
parent 48581734fe
commit ec75aaed63

View File

@ -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: