Optimize if statements in the client module (#8998)

This commit is contained in:
William Collishaw
2019-06-11 06:44:30 -06:00
committed by Tomas Slusny
parent 7e0017fe4d
commit 43c04992bc
4 changed files with 4 additions and 21 deletions

View File

@@ -66,10 +66,6 @@ class CacheKey
{ {
return false; return false;
} }
if (this.type != other.type) return this.type == other.type;
{
return false;
}
return true;
} }
} }

View File

@@ -1314,10 +1314,7 @@ public class GpuPlugin extends Plugin implements DrawCallbacks
{ {
int var21 = (pitchCos * modelHeight >> 16) + var19; int var21 = (pitchCos * modelHeight >> 16) + var19;
int var22 = (var18 - var21) * zoom; int var22 = (var18 - var21) * zoom;
if (var22 / var14 < Rasterizer3D_clipMidY2) return var22 / var14 < Rasterizer3D_clipMidY2;
{
return true;
}
} }
} }
} }

View File

@@ -123,12 +123,7 @@ public class KeyRemappingPlugin extends Plugin
// the search box on the world map can be focused, and chat input goes there, even // the search box on the world map can be focused, and chat input goes there, even
// though the chatbox still has its key listener. // though the chatbox still has its key listener.
Widget worldMapSearch = client.getWidget(WidgetInfo.WORLD_MAP_SEARCH); Widget worldMapSearch = client.getWidget(WidgetInfo.WORLD_MAP_SEARCH);
if (worldMapSearch != null && client.getVar(VarClientInt.WORLD_MAP_SEARCH_FOCUSED) == 1) return worldMapSearch == null || client.getVar(VarClientInt.WORLD_MAP_SEARCH_FOCUSED) != 1;
{
return false;
}
return true;
} }
/** /**

View File

@@ -215,11 +215,6 @@ public class PuzzleState
return true; return true;
} }
if (y1 == y2 && absX == 1) return y1 == y2 && absX == 1;
{
return true;
}
return false;
} }
} }