From ecd5d188187f2ebaaad8ded0ffe53538911f7898 Mon Sep 17 00:00:00 2001 From: FlorianMichael <60033407+FlorianMichael@users.noreply.github.com> Date: Tue, 12 Dec 2023 22:16:37 +0100 Subject: [PATCH] Optimize code --- .../de/florianmichael/viafabricplus/save/AbstractSave.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/main/java/de/florianmichael/viafabricplus/save/AbstractSave.java b/src/main/java/de/florianmichael/viafabricplus/save/AbstractSave.java index 6a425f8a..83a828ae 100644 --- a/src/main/java/de/florianmichael/viafabricplus/save/AbstractSave.java +++ b/src/main/java/de/florianmichael/viafabricplus/save/AbstractSave.java @@ -49,15 +49,11 @@ public abstract class AbstractSave { */ public void init() { if (file.exists()) { - JsonObject parentNode = null; try (final FileReader fr = new FileReader(file)) { - parentNode = GSON.fromJson(fr, JsonObject.class); + read(GSON.fromJson(fr, JsonObject.class)); } catch (Exception e) { ViaFabricPlus.global().getLogger().error("Failed to read file: " + file.getName() + "!"); } - if (parentNode != null) { - read(parentNode); - } } }