File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -252,9 +252,15 @@ async def parse_steam_user_games(
252252 # remove all of the games that we used that were already cached
253253 # this ensures that the timestamps of those games don't get updated
254254 game_ratings_copy = game_ratings .copy ()
255- for game in game_ratings_copy :
256- if cache .get_game_data (game .app_id ) is not None :
257- game_ratings_copy .remove (game )
255+ games_to_remove : List [Game ] = [
256+ game
257+ for game in game_ratings_copy
258+ if cache .get_game_data (game .app_id ) is not None
259+ ]
260+
261+ # we do this in a seperate loop so that we're not mutating the iterable during iteration
262+ for game in games_to_remove :
263+ game_ratings_copy .remove (game )
258264
259265 # update the game cache
260266 cache .update_cache (game_list = game_ratings )
You can’t perform that action at this time.
0 commit comments