DroidFish: In computeNetEngineID(), don't read the whole engine file when the engine is not a network engine.

This commit is contained in:
Peter Osterlund 2014-07-14 22:53:56 +00:00
parent 234e15dd98
commit d5a640440b

View File

@ -1224,9 +1224,11 @@ public class DroidFish extends Activity implements GUIInterface {
String id = "";
try {
String engine = settings.getString("engine", "stockfish");
String[] lines = Util.readFile(engine);
if (lines.length >= 3)
id = lines[1] + ":" + lines[2];
if (EngineUtil.isNetEngine(engine)) {
String[] lines = Util.readFile(engine);
if (lines.length >= 3)
id = lines[1] + ":" + lines[2];
}
} catch (IOException e) {
}
engineOptions.networkID = id;