mirror of
https://github.com/sockspls/badfish
synced 2025-04-30 08:43:09 +00:00
Avoid unnecessary string copies
closes https://github.com/official-stockfish/Stockfish/pull/4326 also fixes typo, closes https://github.com/official-stockfish/Stockfish/pull/4332 No functional change
This commit is contained in:
parent
e9e7a7b83f
commit
4f4e652eca
3 changed files with 3 additions and 3 deletions
|
@ -89,7 +89,7 @@ namespace Eval {
|
|||
vector<string> dirs = { "<internal>" , "" , CommandLine::binaryDirectory };
|
||||
#endif
|
||||
|
||||
for (string directory : dirs)
|
||||
for (const string& directory : dirs)
|
||||
if (currentEvalFileName != eval_file)
|
||||
{
|
||||
if (directory != "<internal>")
|
||||
|
|
|
@ -106,7 +106,7 @@ namespace Stockfish::Eval::NNUE::Layers {
|
|||
|
||||
for (IndexType i = Start; i < InputDimensions; ++i) {
|
||||
output[i] = static_cast<OutputType>(
|
||||
// realy should be /127 but we need to make it fast
|
||||
// really should be /127 but we need to make it fast
|
||||
// needs to be accounted for in the trainer
|
||||
std::max(0ll, std::min(127ll, (((long long)input[i] * input[i]) >> (2 * WeightScaleBits)) / 128)));
|
||||
}
|
||||
|
|
|
@ -160,7 +160,7 @@ namespace {
|
|||
uint64_t num, nodes = 0, cnt = 1;
|
||||
|
||||
vector<string> list = setup_bench(pos, args);
|
||||
num = count_if(list.begin(), list.end(), [](string s) { return s.find("go ") == 0 || s.find("eval") == 0; });
|
||||
num = count_if(list.begin(), list.end(), [](const string& s) { return s.find("go ") == 0 || s.find("eval") == 0; });
|
||||
|
||||
TimePoint elapsed = now();
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue