search: 删除 deleteTree() 中不必要的判断

This commit is contained in:
Calcitem 2019-12-04 23:53:52 +08:00
parent 42f774548a
commit 99a18af8ce
1 changed files with 2 additions and 8 deletions

View File

@ -448,19 +448,13 @@ void AIAlgorithm::sortMoves(Node *node)
void AIAlgorithm::deleteTree(Node *node)
{
// 递归删除节点树
if (node == nullptr) {
return;
}
int nchild = node->childrenSize;
for (int i = 0; i < nchild; i++) {
deleteTree(node->children[i]);
}
if (node->childrenSize) {
node->childrenSize = 0;
}
node->childrenSize = 0;
memmgr.memmgr_free(node);
}