From 12817989926f8c4e7efe2da3880d1b182fa1a602 Mon Sep 17 00:00:00 2001 From: degasus Date: Thu, 11 Dec 2014 22:47:56 +0100 Subject: [PATCH] VertexLoaderUid: remove operator< Not needed for unordered map. --- .../VideoBackends/Software/SWVertexLoader.h | 2 +- Source/Core/VideoCommon/VertexLoader.h | 30 +++++++------------ .../Core/VideoCommon/VertexLoaderManager.cpp | 14 --------- 3 files changed, 12 insertions(+), 34 deletions(-) diff --git a/Source/Core/VideoBackends/Software/SWVertexLoader.h b/Source/Core/VideoBackends/Software/SWVertexLoader.h index 4a5d38d52a..fe4e5347ba 100644 --- a/Source/Core/VideoBackends/Software/SWVertexLoader.h +++ b/Source/Core/VideoBackends/Software/SWVertexLoader.h @@ -28,7 +28,7 @@ class SWVertexLoader bool m_TexGenSpecialCase; - std::map> m_VertexLoaderMap; + std::unordered_map> m_VertexLoaderMap; std::vector m_LoadedVertices; VertexLoader* m_CurrentLoader; diff --git a/Source/Core/VideoCommon/VertexLoader.h b/Source/Core/VideoCommon/VertexLoader.h index 801978231b..4594e43d47 100644 --- a/Source/Core/VideoCommon/VertexLoader.h +++ b/Source/Core/VideoCommon/VertexLoader.h @@ -57,25 +57,6 @@ public: hash = CalculateHash(); } - bool operator < (const VertexLoaderUID &other) const - { - // This is complex because of speed. - if (vid[0] < other.vid[0]) - return true; - else if (vid[0] > other.vid[0]) - return false; - - for (int i = 1; i < 5; ++i) - { - if (vid[i] < other.vid[i]) - return true; - else if (vid[i] > other.vid[i]) - return false; - } - - return false; - } - bool operator == (const VertexLoaderUID& rh) const { return hash == rh.hash && std::equal(vid, vid + sizeof(vid) / sizeof(vid[0]), rh.vid); @@ -101,6 +82,17 @@ private: } }; +namespace std +{ +template <> struct hash +{ + size_t operator()(const VertexLoaderUID& uid) const + { + return uid.GetHash(); + } +}; +} + // ARMTODO: This should be done in a better way #ifndef _M_GENERIC class VertexLoader : public Gen::X64CodeBlock diff --git a/Source/Core/VideoCommon/VertexLoaderManager.cpp b/Source/Core/VideoCommon/VertexLoaderManager.cpp index e1d0b194ef..1bfd05cace 100644 --- a/Source/Core/VideoCommon/VertexLoaderManager.cpp +++ b/Source/Core/VideoCommon/VertexLoaderManager.cpp @@ -23,20 +23,6 @@ static NativeVertexFormat* s_current_vtx_fmt; -namespace std -{ - -template <> -struct hash -{ - size_t operator()(const VertexLoaderUID& uid) const - { - return uid.GetHash(); - } -}; - -} - typedef std::unordered_map> VertexLoaderMap; namespace VertexLoaderManager