spellbook: Use entrySet instead of accessing the map multiple times

This commit is contained in:
sdburns1998
2019-07-07 21:11:50 +02:00
parent 8ba41631d1
commit 98214d8a4c

View File

@@ -586,11 +586,11 @@ public class SpellbookPlugin extends Plugin
{
ImmutableSet<String> tmp = ImmutableSet.copyOf(notFilteredSpells);
for (int id : spells.keySet())
for (Map.Entry<Integer, Spell> 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;
}