runelite-client: remove various redundant null checks

This commit is contained in:
Adam
2018-06-16 13:44:42 -04:00
parent 9075b44320
commit 44813ce177
4 changed files with 0 additions and 23 deletions

View File

@@ -252,10 +252,6 @@ public class SceneOverlay extends Overlay
lp = new LocalPoint(
lp.getX() + dx * Perspective.LOCAL_TILE_SIZE + dx * Perspective.LOCAL_TILE_SIZE * (area.getWidth() - 1) / 2,
lp.getY() + dy * Perspective.LOCAL_TILE_SIZE + dy * Perspective.LOCAL_TILE_SIZE * (area.getHeight() - 1) / 2);
if (lp == null)
{
return;
}
Polygon poly = Perspective.getCanvasTilePoly(client, lp);
if (poly == null)
@@ -313,10 +309,6 @@ public class SceneOverlay extends Overlay
private void renderTileIfHasLineOfSight(Graphics2D graphics, WorldArea start, int targetX, int targetY)
{
WorldPoint targetLocation = new WorldPoint(targetX, targetY, start.getPlane());
if (targetLocation == null)
{
return;
}
// Running the line of sight algorithm 100 times per frame doesn't
// seem to use much CPU time, however rendering 100 tiles does

View File

@@ -172,11 +172,6 @@ class InstanceMapOverlay extends Overlay
drawPlayerDot(graphics, client.getLocalPlayer(), Color.white, Color.black);
}
if (image == null)
{
return null;
}
return new Dimension(image.getWidth(), image.getHeight());
}

View File

@@ -86,11 +86,6 @@ public class KourendLibraryOverlay extends Overlay
List<Bookcase> allBookcases = library.getBookcasesOnLevel(client.getPlane());
if (allBookcases == null)
{
return null;
}
for (Bookcase bookcase : allBookcases)
{
// AABB

View File

@@ -47,11 +47,6 @@ public class IDAStar extends Pathfinder
{
PuzzleState goalNode = path(root);
if (goalNode == null)
{
return null;
}
List<PuzzleState> path = new ArrayList<>();
PuzzleState parent = goalNode;