From 46f35f0b10404f05abf667ee63a4d9ec948a2207 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Fri, 26 Apr 2024 15:37:37 -0400 Subject: [PATCH] Minor update to keyset() usages --- src/engine/objects/ItemTemplate.java | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/engine/objects/ItemTemplate.java b/src/engine/objects/ItemTemplate.java index f0a07cb3..206dde0f 100644 --- a/src/engine/objects/ItemTemplate.java +++ b/src/engine/objects/ItemTemplate.java @@ -181,8 +181,7 @@ public class ItemTemplate { JSONObject obj_sparse_json = jsonObject.getJSONObject("obj_sparse_data"); - for (Object key : obj_sparse_json.keySet()) { - String sparseType = key.toString(); + for (String sparseType : obj_sparse_json.keySet()) { Object sparseValue = obj_sparse_json.get(sparseType); obj_sparse_data.put(sparseType, sparseValue.toString()); } @@ -202,9 +201,9 @@ public class ItemTemplate { JSONObject resist_json = jsonObject.getJSONObject("combat_attack_resist"); - for (String key : resist_json.keySet()) { - float resist = resist_json.getFloat(key); - combat_attack_resist.put(key, resist); + for (String resistType : resist_json.keySet()) { + float resistValue = resist_json.getFloat(resistType); + combat_attack_resist.put(resistType, resistValue); } // Parsing an enum @@ -554,8 +553,7 @@ public class ItemTemplate { JSONObject rune_sparse_json = jsonObject.getJSONObject("rune_sparse_data"); - for (Object key : rune_sparse_json.keySet()) { - String sparseType = key.toString(); + for (String sparseType : rune_sparse_json.keySet()) { Object sparseValue = rune_sparse_json.get(sparseType); rune_sparse_data.put(sparseType, sparseValue.toString()); }