X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fmaterial.cpp;h=845519bc41648cedd2a7933564d4307b5ceafffa;hp=8a13d11559737ce36f3e6d88125e607131c55b7e;hb=46c0bdb74f104aa8a293c660689f84aae3ca75b3;hpb=bbd3e30b4e297877f1e1cad3e5b942175c58290b diff --git a/src/material.cpp b/src/material.cpp index 8a13d115..845519bc 100644 --- a/src/material.cpp +++ b/src/material.cpp @@ -23,7 +23,6 @@ //// #include -#include #include #include @@ -94,7 +93,6 @@ MaterialInfoTable::MaterialInfoTable(unsigned int numOfEntries) { << " bytes for material hash table." << std::endl; Application::exit_with_failure(); } - clear(); } @@ -102,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; } @@ -154,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;