Skip to content
This repository has been archived by the owner on Jan 18, 2024. It is now read-only.

Commit

Permalink
Core/Misc: Remove incorrect (and unused) equality operator overloads …
Browse files Browse the repository at this point in the history
…from LinkedListHead::Iterator class
  • Loading branch information
Shauren authored and Ovahlord committed Oct 18, 2023
1 parent 2e2a928 commit 031e41c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 36 deletions.
2 changes: 1 addition & 1 deletion src/server/game/Maps/Map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3207,7 +3207,7 @@ Transport* Map::GetTransport(ObjectGuid const& guid)

void Map::UpdateIteratorBack(Player* player)
{
if (m_mapRefIter == player->GetMapRef())
if (&*m_mapRefIter == &player->GetMapRef())
m_mapRefIter = m_mapRefIter->nocheck_prev();
}

Expand Down
38 changes: 3 additions & 35 deletions src/server/shared/Dynamic/LinkedList.h
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ class LinkedListHead
{ // construct with null node pointer
}

Iterator(pointer _Pnode) : _Ptr(_Pnode)
explicit Iterator(pointer _Pnode) : _Ptr(_Pnode)
{ // construct with node pointer _Pnode
}

Expand Down Expand Up @@ -206,40 +206,8 @@ class LinkedListHead
return (_Tmp);
}

bool operator==(Iterator const &_Right) const
{ // test for iterator equality
return (_Ptr == _Right._Ptr);
}

bool operator!=(Iterator const &_Right) const
{ // test for iterator inequality
return (!(*this == _Right));
}

bool operator==(pointer const &_Right) const
{ // test for pointer equality
return (_Ptr != _Right);
}

bool operator!=(pointer const &_Right) const
{ // test for pointer equality
return (!(*this == _Right));
}

bool operator==(const_reference _Right) const
{ // test for reference equality
return (_Ptr == &_Right);
}

bool operator!=(const_reference _Right) const
{ // test for reference equality
return (_Ptr != &_Right);
}

pointer _Mynode()
{ // return node pointer
return (_Ptr);
}
bool operator==(Iterator const& _Right) const = default;
// test for iterator equality

protected:
pointer _Ptr; // pointer to node
Expand Down

0 comments on commit 031e41c

Please sign in to comment.