From e8c627dc4dde2d6b60597a34d1594e7ae5b86b8c Mon Sep 17 00:00:00 2001 From: Christian Heller Date: Wed, 2 Mar 2016 02:53:54 +0100 Subject: [PATCH] Server: Simplify code. --- server/io.py | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/server/io.py b/server/io.py index a483e2d..bb5d3ac 100644 --- a/server/io.py +++ b/server/io.py @@ -174,8 +174,6 @@ def save_world(): x = world_db[category][_id][key] argument = quote_escape(x) if str == type(x) else str(x) string = string + key + " " + argument + "\n" - elif special_keys[key]: - string = string + special_keys[key](_id) return string def helper_things(): @@ -194,25 +192,6 @@ def save_world(): string += memthing(tid) + memmap(tid) + memdepthmap(tid) return string - # ALTERNATIVE TO helper_things, but not more efficient despite listcomp - # def helper4(): - # def foo(t, key): - # argument = t[key] - # return key + " " + (quote_escape(argument) if \ - # str == type(argument) else str(argument)) + "\n" - # string = "" - # memmap = mapsetter("T_MEMMAP") - # memdepthmap = mapsetter("T_MEMDEPTHMAP") - # for tid in sorted(world_db["Things"].keys()): - # string += "T_ID " + str(tid) + "\n" - # t = world_db["Things"][tid] - # lines = [foo(t, key) for key in sorted(t.keys()) - # if key not in {"T_CARRIES", "carried", "fovmap", - # "T_MEMMAP", "T_MEMTHING", "T_MEMDEPTHMAP"}] - # string += "".join(lines) - # string += memthing(tid) + memmap(tid) + memdepthmap(tid) - # return string - string = "" for plugin in world_db["PLUGIN"]: string = string + "PLUGIN " + plugin + "\n" -- 2.30.2