Skip to content

Commit 29480bd

Browse files
committed
Altered dict search operation into a comprehension
1 parent 163a61c commit 29480bd

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

worlds/sm64ex/Rules.py

+1-4
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,7 @@ def set_rules(world, player: int, area_connections: dict, star_costs: dict, move
3232
randomized_level_to_paintings = shuffle_dict_keys(world,sm64_level_to_paintings)
3333
if world.AreaRandomizer[player].value < 3 and move_rando_bitvec > 0:
3434
first_course = world.random.choice(valid_move_randomizer_start_courses)
35-
for entrance, painting in randomized_level_to_paintings.items():
36-
if painting == first_course:
37-
original_entrance = entrance
38-
break
35+
original_entrance = next(entrance for entrance, painting in randomized_level_to_paintings.items() if painting == first_course)
3936
randomized_level_to_paintings[original_entrance] = randomized_level_to_paintings[91]
4037
randomized_level_to_paintings[91] = first_course
4138

0 commit comments

Comments
 (0)