Switch to an unordered_map as a micro-optimization.

This commit is contained in:
comex
2014-08-27 22:37:08 -04:00
parent f8452ff501
commit 90638c6806
3 changed files with 18 additions and 4 deletions

View File

@ -4,7 +4,7 @@
#pragma once
#include "Common/CommonTypes.h"
#include "Common/Hash.h"
// m_components
enum
@ -87,6 +87,20 @@ struct PortableVertexDeclaration
}
};
namespace std
{
template <>
struct hash<PortableVertexDeclaration>
{
size_t operator()(const PortableVertexDeclaration& decl) const
{
return HashFletcher((u8 *) &decl, sizeof(decl));
}
};
}
// The implementation of this class is specific for GL/DX, so NativeVertexFormat.cpp
// is in the respective backend, not here in VideoCommon.