修复开启 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);
|
return bookHashMap.find(hash, hashValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
int NineChessAi_ab::recordBookHash(const HashValue &hashValue)
|
int NineChessAi_ab::recordBookHash(uint64_t hash, const HashValue &hashValue)
|
||||||
{
|
{
|
||||||
//hashMapMutex.lock();
|
//hashMapMutex.lock();
|
||||||
bookHashMap.insert(hashValue.hash, hashValue);
|
bookHashMap.insert(hash, hashValue);
|
||||||
//hashMapMutex.unlock();
|
//hashMapMutex.unlock();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -1078,6 +1078,7 @@ void NineChessAi_ab::clearBookHashMap()
|
||||||
void NineChessAi_ab::recordOpeningBookToHashMap()
|
void NineChessAi_ab::recordOpeningBookToHashMap()
|
||||||
{
|
{
|
||||||
HashValue hashValue;
|
HashValue hashValue;
|
||||||
|
uint64_t hash = 0;
|
||||||
|
|
||||||
for (auto iter = openingBook.begin(); iter != openingBook.end(); ++iter)
|
for (auto iter = openingBook.begin(); iter != openingBook.end(); ++iter)
|
||||||
{
|
{
|
||||||
|
@ -1087,8 +1088,8 @@ void NineChessAi_ab::recordOpeningBookToHashMap()
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
memset(&hashValue, 0, sizeof(HashValue));
|
memset(&hashValue, 0, sizeof(HashValue));
|
||||||
hashValue.hash = *iter;
|
hash = *iter;
|
||||||
recordBookHash(hashValue); // 暂时使用直接覆盖策略
|
recordBookHash(hash, hashValue); // 暂时使用直接覆盖策略
|
||||||
}
|
}
|
||||||
|
|
||||||
openingBook.clear();
|
openingBook.clear();
|
||||||
|
|
|
@ -113,7 +113,7 @@ public:
|
||||||
|
|
||||||
#ifdef BOOK_LEARNING
|
#ifdef BOOK_LEARNING
|
||||||
bool findBookHash(uint64_t hash, HashValue &hashValue);
|
bool findBookHash(uint64_t hash, HashValue &hashValue);
|
||||||
static int recordBookHash(const HashValue &hashValue);
|
static int recordBookHash(uint64_t hash, const HashValue &hashValue);
|
||||||
void clearBookHashMap();
|
void clearBookHashMap();
|
||||||
static void recordOpeningBookToHashMap();
|
static void recordOpeningBookToHashMap();
|
||||||
#endif // BOOK_LEARNING
|
#endif // BOOK_LEARNING
|
||||||
|
|
Loading…
Reference in New Issue