Skip to content

Commit

Permalink
Use emplace_back in TB code
Browse files Browse the repository at this point in the history
No functional change.
  • Loading branch information
UniQP committed Nov 27, 2018
1 parent 7b6fa35 commit 191a7d8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/syzygy/tbprobe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1277,7 +1277,7 @@ void Tablebases::init(const std::string& paths) {
continue; // First on diagonal, second above

else if (!off_A1H8(s1) && !off_A1H8(s2))
bothOnDiagonal.push_back(std::make_pair(idx, s2));
bothOnDiagonal.emplace_back(idx, s2);

else
MapKK[idx][s2] = code++;
Expand Down
4 changes: 2 additions & 2 deletions src/tt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ void TranspositionTable::clear() {

for (size_t idx = 0; idx < Options["Threads"]; idx++)
{
threads.push_back(std::thread([this, idx]() {
threads.emplace_back([this, idx]() {

// Thread binding gives faster search on systems with a first-touch policy
if (Options["Threads"] > 8)
Expand All @@ -97,7 +97,7 @@ void TranspositionTable::clear() {
stride : clusterCount - start;

std::memset(&table[start], 0, len * sizeof(Cluster));
}));
});
}

for (std::thread& th: threads)
Expand Down

0 comments on commit 191a7d8

Please sign in to comment.