Opt: Skip saving if rows are the same to reduce logs

This commit is contained in:
LmeSzinc 2024-06-18 12:35:39 +08:00
parent 5a7097fc9d
commit 2ac396b18b

View File

@ -686,7 +686,9 @@ class PlannerMixin(UI):
with self.config.multi_set(): with self.config.multi_set():
# Set value # Set value
for key, value in data.items(): for key, value in data.items():
self.config.cross_set(f'Dungeon.Planner.{key}', value) current = self.config.cross_get(f'Dungeon.Planner.{key}', default={})
if value != current:
self.config.cross_set(f'Dungeon.Planner.{key}', value)
# Remove other value # Remove other value
remove = [] remove = []
for key, value in self.config.cross_get('Dungeon.Planner', default={}).items(): for key, value in self.config.cross_get('Dungeon.Planner', default={}).items():