From 490bacfce0e2f336197eafbb8149d7e4db8818da Mon Sep 17 00:00:00 2001 From: Hamidreza Bayat Date: Sun, 28 Apr 2019 19:44:32 +0430 Subject: [PATCH] Remove redundant type casts --- .../src/main/java/chess/TranspositionTable.java | 8 ++++---- CuckooChessEngine/src/main/java/chess/TreeLogger.java | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CuckooChessEngine/src/main/java/chess/TranspositionTable.java b/CuckooChessEngine/src/main/java/chess/TranspositionTable.java index b0141d3..d9d820a 100644 --- a/CuckooChessEngine/src/main/java/chess/TranspositionTable.java +++ b/CuckooChessEngine/src/main/java/chess/TranspositionTable.java @@ -150,7 +150,7 @@ public class TranspositionTable { altEnt.move = ent.move; altEnt.score = ent.score; altEnt.depthSlot = ent.depthSlot; - altEnt.generation = (byte)ent.generation; + altEnt.generation = ent.generation; altEnt.type = ent.type; altEnt.setHashSlot(1 - ent.getHashSlot()); altEnt.evalScore = ent.evalScore; @@ -173,7 +173,7 @@ public class TranspositionTable { ent.key = key; ent.setScore(sm.score, ply); ent.setDepth(depth); - ent.generation = (byte)generation; + ent.generation = generation; ent.type = (byte)type; ent.setHashSlot(hashSlot); ent.evalScore = (short)evalScore; @@ -185,13 +185,13 @@ public class TranspositionTable { int idx0 = h0(key); TTEntry ent = table[idx0]; if (ent.key == key) { - ent.generation = (byte)generation; + ent.generation = generation; return ent; } int idx1 = h1(key); ent = table[idx1]; if (ent.key == key) { - ent.generation = (byte)generation; + ent.generation = generation; return ent; } return emptySlot; diff --git a/CuckooChessEngine/src/main/java/chess/TreeLogger.java b/CuckooChessEngine/src/main/java/chess/TreeLogger.java index a183dcc..c36dc36 100644 --- a/CuckooChessEngine/src/main/java/chess/TreeLogger.java +++ b/CuckooChessEngine/src/main/java/chess/TreeLogger.java @@ -152,7 +152,7 @@ public final class TreeLogger { * @return node index */ final long logNodeStart(long parentIndex, Move m, int alpha, int beta, int ply, int depth) { - bb.putInt ( 0, (int)-1); + bb.putInt ( 0, -1); bb.putInt ( 4, (int)parentIndex); bb.putShort( 8, (short)(m.from + (m.to << 6) + (m.promoteTo << 12))); bb.putShort(10, (short)alpha);