From a1696495005f700e92236168f0c374bd3a21d6c4 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Mon, 20 May 2024 00:35:46 -0400 Subject: [PATCH] Use world.web.options_presets directly instead of creating an empty dict first --- WebHostLib/options.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/WebHostLib/options.py b/WebHostLib/options.py index f52f0f3d9f..94f173df70 100644 --- a/WebHostLib/options.py +++ b/WebHostLib/options.py @@ -79,10 +79,6 @@ def test_ordered(obj): @cache.cached() def option_presets(game: str) -> Response: world = AutoWorldRegister.world_types[game] - presets = {} - - if world.web.options_presets: - presets = presets | world.web.options_presets class SetEncoder(json.JSONEncoder): def default(self, obj): @@ -91,7 +87,7 @@ def option_presets(game: str) -> Response: return list(obj) return json.JSONEncoder.default(self, obj) - json_data = json.dumps(presets, cls=SetEncoder) + json_data = json.dumps(world.web.options_presets, cls=SetEncoder) response = Response(json_data) response.headers["Content-Type"] = "application/json" return response