Commit f02e7f8e authored by Martin Weismann's avatar Martin Weismann
Browse files

Use unordered map to increase performance

Showing with 5 additions and 5 deletions
+5 -5
......@@ -94,8 +94,7 @@ namespace NMR {
std::string m_sCurPath;
std::string m_sRootPath;
std::map<std::string, PUUID> usedUUIDs; // datastructure used to ensure that UUIDs within one model (package) are unique
std::unordered_map<std::string, PUUID> usedUUIDs; // datastructure used to ensure that UUIDs within one model (package) are unique
// Object Resources of the model
std::map<PackageResourceID, PModelResource> m_ResourceMap;
......@@ -121,14 +120,14 @@ namespace NMR {
// Model Attachments
std::vector<PModelAttachment> m_Attachments;
std::map<std::string, PModelAttachment> m_AttachmentURIMap;
std::unordered_map<std::string, PModelAttachment> m_AttachmentURIMap;
// Custom Attachment Content Types
std::map<std::string, std::string> m_CustomContentTypes;
// Production Model Attachments
std::vector<PModelAttachment> m_ProductionAttachments;
std::map<std::string, PModelAttachment> m_ProductionAttachmentURIMap;
std::unordered_map<std::string, PModelAttachment> m_ProductionAttachmentURIMap;
// Indexed lookup lists for standard resource types
std::vector<PModelResource> m_ObjectLookup;
......
......@@ -38,6 +38,7 @@ NMR_PackageResourceID.h defines the PackageResourceID Class.
#include <memory>
#include <map>
#include <unordered_map>
#include <vector>
namespace NMR {
......@@ -63,7 +64,7 @@ namespace NMR {
class CResourceHandler {
private:
// unique IDs to CPackageResourceID
std::map<PackageResourceID, PPackageResourceID> m_resourceIDs;
std::unordered_map<PackageResourceID, PPackageResourceID> m_resourceIDs;
std::map<std::pair<ModelResourceID, std::string>, PPackageResourceID> m_IdAndPathToResourceIDs;
public:
PPackageResourceID getNewResourceID(std::string path, ModelResourceID id); // this is supposed to be the only way to generate a CPackageResourceID
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment