(svn r9693) -Codechange [YAPF]: GetBestNode() now returns pointer to node instead of reference

This commit is contained in:
KUDr
2007-04-20 19:13:35 +00:00
parent 17dc1c6336
commit 4728765870
4 changed files with 14 additions and 13 deletions

View File

@@ -117,7 +117,8 @@ public:
while (true) {
m_num_steps++;
Node *n = m_nodes.GetBestOpenNode();
if (n == NULL) break;
if (n == NULL)
break;
// if the best open node was worse than the best path found, we can finish
if (m_pBestDestNode != NULL && m_pBestDestNode->GetCost() < n->GetCostEstimate())
@@ -160,9 +161,9 @@ public:
/** If path was found return the best node that has reached the destination. Otherwise
* return the best visited node (which was nearest to the destination).
*/
FORCEINLINE Node& GetBestNode()
FORCEINLINE Node* GetBestNode()
{
return (m_pBestDestNode != NULL) ? *m_pBestDestNode : *m_pBestIntermediateNode;
return (m_pBestDestNode != NULL) ? m_pBestDestNode : m_pBestIntermediateNode;
}
/** Calls NodeList::CreateNewNode() - allocates new node that can be filled and used