修复开启 BOOK_LEARNING 宏后编译不通过的问题
This commit is contained in:
parent
58d42fb8ba
commit
5899b14f92
|
@ -1059,10 +1059,10 @@ bool NineChessAi_ab::findBookHash(uint64_t hash, HashValue &hashValue)
|
|||
return bookHashMap.find(hash, hashValue);
|
||||
}
|
||||
|
||||
int NineChessAi_ab::recordBookHash(const HashValue &hashValue)
|
||||
int NineChessAi_ab::recordBookHash(uint64_t hash, const HashValue &hashValue)
|
||||
{
|
||||
//hashMapMutex.lock();
|
||||
bookHashMap.insert(hashValue.hash, hashValue);
|
||||
bookHashMap.insert(hash, hashValue);
|
||||
//hashMapMutex.unlock();
|
||||
|
||||
return 0;
|
||||
|
@ -1078,6 +1078,7 @@ void NineChessAi_ab::clearBookHashMap()
|
|||
void NineChessAi_ab::recordOpeningBookToHashMap()
|
||||
{
|
||||
HashValue hashValue;
|
||||
uint64_t hash = 0;
|
||||
|
||||
for (auto iter = openingBook.begin(); iter != openingBook.end(); ++iter)
|
||||
{
|
||||
|
@ -1087,8 +1088,8 @@ void NineChessAi_ab::recordOpeningBookToHashMap()
|
|||
}
|
||||
#endif
|
||||
memset(&hashValue, 0, sizeof(HashValue));
|
||||
hashValue.hash = *iter;
|
||||
recordBookHash(hashValue); // 暂时使用直接覆盖策略
|
||||
hash = *iter;
|
||||
recordBookHash(hash, hashValue); // 暂时使用直接覆盖策略
|
||||
}
|
||||
|
||||
openingBook.clear();
|
||||
|
|
|
@ -113,7 +113,7 @@ public:
|
|||
|
||||
#ifdef BOOK_LEARNING
|
||||
bool findBookHash(uint64_t hash, HashValue &hashValue);
|
||||
static int recordBookHash(const HashValue &hashValue);
|
||||
static int recordBookHash(uint64_t hash, const HashValue &hashValue);
|
||||
void clearBookHashMap();
|
||||
static void recordOpeningBookToHashMap();
|
||||
#endif // BOOK_LEARNING
|
||||
|
|
Loading…
Reference in New Issue