Small cleanup

This commit is contained in:
Peter Osterlund 2020-04-19 22:52:07 +02:00
parent 7c75c83859
commit 795428992f
2 changed files with 4 additions and 13 deletions

View File

@ -170,15 +170,12 @@ public class DroidEngineControl {
/** /**
* Compute thinking time for current search. * Compute thinking time for current search.
*/ */
final public void computeTimeLimit(SearchParams sPar) { private void computeTimeLimit(SearchParams sPar) {
minTimeLimit = -1; minTimeLimit = -1;
maxTimeLimit = -1; maxTimeLimit = -1;
maxDepth = -1; maxDepth = -1;
maxNodes = -1; maxNodes = -1;
if (sPar.infinite) { if (sPar.infinite) {
minTimeLimit = -1;
maxTimeLimit = -1;
maxDepth = -1;
} else if (sPar.depth > 0) { } else if (sPar.depth > 0) {
maxDepth = sPar.depth; maxDepth = sPar.depth;
} else if (sPar.mate > 0) { } else if (sPar.mate > 0) {
@ -212,13 +209,7 @@ public class DroidEngineControl {
} }
private static int clamp(int val, int min, int max) { private static int clamp(int val, int min, int max) {
if (val < min) { return Math.min(Math.max(val, min), max);
return min;
} else if (val > max) {
return max;
} else {
return val;
}
} }
private void startThread(final int minTimeLimit, final int maxTimeLimit, private void startThread(final int minTimeLimit, final int maxTimeLimit,
@ -277,7 +268,7 @@ public class DroidEngineControl {
engineThread.start(); engineThread.start();
} }
final public void stopThread() { private void stopThread() {
Thread myThread; Thread myThread;
Search mySearch; Search mySearch;
synchronized (threadMutex) { synchronized (threadMutex) {

View File

@ -61,7 +61,7 @@ public abstract class ChessBoard extends View {
public boolean highlightLastMove; // If true, last move is marked with a rectangle public boolean highlightLastMove; // If true, last move is marked with a rectangle
public boolean blindMode; // If true, no chess pieces and arrows are drawn public boolean blindMode; // If true, no chess pieces and arrows are drawn
List<Move> moveHints; private List<Move> moveHints;
/** Decoration for a square. Currently the only possible decoration is a tablebase probe result. */ /** Decoration for a square. Currently the only possible decoration is a tablebase probe result. */
public final static class SquareDecoration implements Comparable<SquareDecoration> { public final static class SquareDecoration implements Comparable<SquareDecoration> {