summaryrefslogtreecommitdiff
path: root/src/pathfinder/yapf
diff options
context:
space:
mode:
authoryexo <yexo@openttd.org>2010-02-25 11:48:50 +0000
committeryexo <yexo@openttd.org>2010-02-25 11:48:50 +0000
commitdd03cd54ee0050367e9583572ed9fadc083b4811 (patch)
treef25ed4bb8caacdeb44ab0e133c02d5abe5d50bef /src/pathfinder/yapf
parent7537fb18bcd1845d24b3fa3a71b36487edd3f1b7 (diff)
downloadopenttd-dd03cd54ee0050367e9583572ed9fadc083b4811.tar.xz
(svn r19242) -Codechange: Perfer pointer instead of reference (skidd13)
-Cleanup: merge PopHead() and RemoveHead() into Shift()
Diffstat (limited to 'src/pathfinder/yapf')
-rw-r--r--src/pathfinder/yapf/nodelist.hpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/pathfinder/yapf/nodelist.hpp b/src/pathfinder/yapf/nodelist.hpp
index 9260c45f7..6ac3b944c 100644
--- a/src/pathfinder/yapf/nodelist.hpp
+++ b/src/pathfinder/yapf/nodelist.hpp
@@ -93,7 +93,7 @@ public:
{
assert(m_closed.Find(item.GetKey()) == NULL);
m_open.Push(item);
- m_open_queue.Push(item);
+ m_open_queue.Push(&item);
if (&item == m_new_node) {
m_new_node = NULL;
}
@@ -103,8 +103,7 @@ public:
FORCEINLINE Titem_ *GetBestOpenNode()
{
if (!m_open_queue.IsEmpty()) {
- Titem_& item = m_open_queue.GetHead();
- return &item;
+ return m_open_queue.Begin();
}
return NULL;
}
@@ -113,9 +112,9 @@ public:
FORCEINLINE Titem_ *PopBestOpenNode()
{
if (!m_open_queue.IsEmpty()) {
- Titem_& item = m_open_queue.PopHead();
- m_open.Pop(item);
- return &item;
+ Titem_ *item = m_open_queue.Shift();
+ m_open.Pop(*item);
+ return item;
}
return NULL;
}