]> git.sesse.net Git - stockfish/blobdiff - src/syzygy/tbprobe.cpp
Use emplace_back() in TB code
[stockfish] / src / syzygy / tbprobe.cpp
index 235fe1953bf97505a8be256b617ef124d9647278..d0b59f056a9c02119c7ca3ce94e3c6a7dd1341bd 100644 (file)
@@ -216,6 +216,7 @@ public:
         fstat(fd, &statbuf);
         *mapping = statbuf.st_size;
         *baseAddress = mmap(nullptr, statbuf.st_size, PROT_READ, MAP_SHARED, fd, 0);
+        madvise(*baseAddress, statbuf.st_size, MADV_RANDOM);
         ::close(fd);
 
         if (*baseAddress == MAP_FAILED) {
@@ -1276,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++;