(svn r19242) -Codechange: Perfer pointer instead of reference (skidd13)

-Cleanup: merge PopHead() and RemoveHead() into Shift()
This commit is contained in:
yexo
2010-02-25 11:48:50 +00:00
parent a44f12ade5
commit 4b6c04585e
2 changed files with 15 additions and 20 deletions

View File

@@ -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;
}