summaryrefslogtreecommitdiff
path: root/src/yapf/yapf_base.hpp
diff options
context:
space:
mode:
authorKUDr <kudr@openttd.org>2007-04-20 19:13:35 +0000
committerKUDr <kudr@openttd.org>2007-04-20 19:13:35 +0000
commit4728765870decb62b63098861dcd841de4e2ad9f (patch)
tree1cf8985a250a13d94e9c28c82417f667b75b70a6 /src/yapf/yapf_base.hpp
parent17dc1c6336eae5ca31b8cee7047bbe49876e061e (diff)
downloadopenttd-4728765870decb62b63098861dcd841de4e2ad9f.tar.xz
(svn r9693) -Codechange [YAPF]: GetBestNode() now returns pointer to node instead of reference
Diffstat (limited to 'src/yapf/yapf_base.hpp')
-rw-r--r--src/yapf/yapf_base.hpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/yapf/yapf_base.hpp b/src/yapf/yapf_base.hpp
index 0d49171cd..b1cb5e993 100644
--- a/src/yapf/yapf_base.hpp
+++ b/src/yapf/yapf_base.hpp
@@ -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