From 98214d8a4c6862dcd2949d82f7c1ee1b9be67203 Mon Sep 17 00:00:00 2001 From: sdburns1998 Date: Sun, 7 Jul 2019 21:11:50 +0200 Subject: [PATCH] spellbook: Use entrySet instead of accessing the map multiple times --- .../runelite/client/plugins/spellbook/SpellbookPlugin.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/spellbook/SpellbookPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/spellbook/SpellbookPlugin.java index a6eae0b652..0502330b79 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/spellbook/SpellbookPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/spellbook/SpellbookPlugin.java @@ -586,11 +586,11 @@ public class SpellbookPlugin extends Plugin { ImmutableSet tmp = ImmutableSet.copyOf(notFilteredSpells); - for (int id : spells.keySet()) + for (Map.Entry spell : spells.entrySet()) { - Widget w = client.getWidget(WidgetInfo.TO_GROUP(id), WidgetInfo.TO_CHILD(id)); // y tho let me just plop in id + Widget w = client.getWidget(WidgetInfo.TO_GROUP(spell.getKey()), WidgetInfo.TO_CHILD(spell.getKey())); // y tho let me just plop in id - if (w == null || !w.getBounds().contains(point) || !isUnfiltered(spells.get(id).getName(), tmp)) + if (w == null || !w.getBounds().contains(point) || !isUnfiltered(spell.getValue().getName(), tmp)) { continue; }