]> git.sesse.net Git - stockfish/blobdiff - src/material.cpp
Revert last tweaks
[stockfish] / src / material.cpp
index c1c3c3c27545653737f2865ef193d04ef8f44b55..845519bc41648cedd2a7933564d4307b5ceafffa 100644 (file)
@@ -23,7 +23,6 @@
 ////
 
 #include <cassert>
-#include <cstring>
 #include <sstream>
 #include <map>
 
@@ -37,6 +36,7 @@ using std::string;
 
 namespace {
 
+  // Values modified by Joona Kiiski
   const Value BishopPairMidgameBonus = Value(109);
   const Value BishopPairEndgameBonus = Value(97);
 
@@ -93,7 +93,6 @@ MaterialInfoTable::MaterialInfoTable(unsigned int numOfEntries) {
                 << " bytes for material hash table." << std::endl;
       Application::exit_with_failure();
   }
-  clear();
 }
 
 
@@ -101,17 +100,8 @@ MaterialInfoTable::MaterialInfoTable(unsigned int numOfEntries) {
 
 MaterialInfoTable::~MaterialInfoTable() {
 
-  delete [] entries;
   delete funcs;
-}
-
-
-/// MaterialInfoTable::clear() clears a material hash table by setting
-/// all entries to 0.
-
-void MaterialInfoTable::clear() {
-
-  memset(entries, 0, size * sizeof(MaterialInfo));
+  delete [] entries;
 }
 
 
@@ -153,14 +143,14 @@ MaterialInfo* MaterialInfoTable::get_material_info(const Position& pos) {
 
   else if (   pos.non_pawn_material(BLACK) == Value(0)
            && pos.piece_count(BLACK, PAWN) == 0
-           && pos.non_pawn_material(WHITE) >= RookValueEndgame)
+           && pos.non_pawn_material(WHITE) >= RookValueMidgame)
   {
       mi->evaluationFunction = &EvaluateKXK;
       return mi;
   }
   else if (   pos.non_pawn_material(WHITE) == Value(0)
            && pos.piece_count(WHITE, PAWN) == 0
-           && pos.non_pawn_material(BLACK) >= RookValueEndgame)
+           && pos.non_pawn_material(BLACK) >= RookValueMidgame)
   {
       mi->evaluationFunction = &EvaluateKKX;
       return mi;