From 031e41c94e4aeeef2773434185bf8bfb6293467f Mon Sep 17 00:00:00 2001 From: Shauren Date: Wed, 18 Oct 2023 22:04:11 +0200 Subject: [PATCH] Core/Misc: Remove incorrect (and unused) equality operator overloads from LinkedListHead::Iterator class --- src/server/game/Maps/Map.cpp | 2 +- src/server/shared/Dynamic/LinkedList.h | 38 ++------------------------ 2 files changed, 4 insertions(+), 36 deletions(-) diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp index 9316879ce37..b2da70f46b5 100644 --- a/src/server/game/Maps/Map.cpp +++ b/src/server/game/Maps/Map.cpp @@ -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(); } diff --git a/src/server/shared/Dynamic/LinkedList.h b/src/server/shared/Dynamic/LinkedList.h index 35424ad82ef..3eb276d2a52 100644 --- a/src/server/shared/Dynamic/LinkedList.h +++ b/src/server/shared/Dynamic/LinkedList.h @@ -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 } @@ -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