1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-04-29 16:23:09 +00:00

Use optional for the engine path

- A small quality of file change is to change the type of engine path
  from a string to an optional string, skips the binary directory
  lookup, which is commonly disabled by people who create wasm builds or
  include stockfish as a library.

closes https://github.com/official-stockfish/Stockfish/pull/5575

No functional change
This commit is contained in:
Disservin 2024-09-07 20:34:10 +02:00
parent a8cb002038
commit effa246071
2 changed files with 3 additions and 3 deletions

View file

@ -47,8 +47,8 @@ namespace NN = Eval::NNUE;
constexpr auto StartFEN = "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1"; constexpr auto StartFEN = "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1";
constexpr int MaxHashMB = Is64Bit ? 33554432 : 2048; constexpr int MaxHashMB = Is64Bit ? 33554432 : 2048;
Engine::Engine(std::string path) : Engine::Engine(std::optional<std::string> path) :
binaryDirectory(CommandLine::get_binary_directory(path)), binaryDirectory(path ? CommandLine::get_binary_directory(*path) : ""),
numaContext(NumaConfig::from_system()), numaContext(NumaConfig::from_system()),
states(new std::deque<StateInfo>(1)), states(new std::deque<StateInfo>(1)),
threads(), threads(),

View file

@ -47,7 +47,7 @@ class Engine {
using InfoFull = Search::InfoFull; using InfoFull = Search::InfoFull;
using InfoIter = Search::InfoIteration; using InfoIter = Search::InfoIteration;
Engine(std::string path = ""); Engine(std::optional<std::string> path = std::nullopt);
// Cannot be movable due to components holding backreferences to fields // Cannot be movable due to components holding backreferences to fields
Engine(const Engine&) = delete; Engine(const Engine&) = delete;