Remove overlayManager#overlayId

It is not used outside of OverlayManager so just swap it with direct use
of indexOf.

Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
This commit is contained in:
Tomas Slusny
2019-01-20 19:20:35 +01:00
parent dedeb79e8b
commit ac6f5af248
2 changed files with 2 additions and 7 deletions

View File

@@ -126,7 +126,7 @@ public class OverlayManager
event.consume(); event.consume();
Optional<Overlay> optionalOverlay = overlays.stream().filter(o -> overlayId(o) == event.getId()).findAny(); Optional<Overlay> optionalOverlay = overlays.stream().filter(o -> overlays.indexOf(o) == event.getId()).findAny();
if (optionalOverlay.isPresent()) if (optionalOverlay.isPresent())
{ {
Overlay overlay = optionalOverlay.get(); Overlay overlay = optionalOverlay.get();
@@ -141,11 +141,6 @@ public class OverlayManager
} }
} }
int overlayId(Overlay overlay)
{
return overlays.indexOf(overlay);
}
/** /**
* Gets all of the overlays on a layer sorted by priority and position * Gets all of the overlays on a layer sorted by priority and position
* *

View File

@@ -550,7 +550,7 @@ public class OverlayRenderer extends MouseAdapter implements KeyListener
entry.setOption(overlayMenuEntry.getOption()); entry.setOption(overlayMenuEntry.getOption());
entry.setTarget(ColorUtil.wrapWithColorTag(overlayMenuEntry.getTarget(), JagexColors.MENU_TARGET)); entry.setTarget(ColorUtil.wrapWithColorTag(overlayMenuEntry.getTarget(), JagexColors.MENU_TARGET));
entry.setType(MenuAction.RUNELITE_OVERLAY.getId()); entry.setType(MenuAction.RUNELITE_OVERLAY.getId());
entry.setIdentifier(overlayManager.overlayId(overlay)); // overlay id entry.setIdentifier(overlayManager.getOverlays().indexOf(overlay)); // overlay id
entries[i] = entry; entries[i] = entry;
} }