From 1850cd159db34ee4f36a60ec713e6b93c46c7b77 Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Thu, 28 Feb 2019 20:23:21 -0500 Subject: [PATCH] My inventory patch everyone's been testing I'm still wary, but let's toss it into our release, shall we? This changes the maps in inventorymodel to unordered maps. On the surface this seems like a good thing, definitely is for inventory loading. It seemed a lot snappier to literally everyone before the HTTP Asset patch rolled out, so that's good. Thanks to Router, Bitten, Gooz, Deltek, Damian, Melaniecosti, Torric, and anyone else I might be forgetting at the moment who tested this for me! --- indra/newview/llinventorymodel.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/indra/newview/llinventorymodel.h b/indra/newview/llinventorymodel.h index b64881f83..915dbc296 100644 --- a/indra/newview/llinventorymodel.h +++ b/indra/newview/llinventorymodel.h @@ -27,7 +27,7 @@ #ifndef LL_LLINVENTORYMODEL_H #define LL_LLINVENTORYMODEL_H -#include +#include #include #include #include @@ -154,13 +154,13 @@ private: // the inventory using several different identifiers. // mInventory member data is the 'master' list of inventory, and // mCategoryMap and mItemMap store uuid->object mappings. - typedef std::map > cat_map_t; - typedef std::map > item_map_t; + typedef std::unordered_map > cat_map_t; + typedef std::unordered_map > item_map_t; cat_map_t mCategoryMap; item_map_t mItemMap; // This last set of indices is used to map parents to children. - typedef std::map parent_cat_map_t; - typedef std::map parent_item_map_t; + typedef std::unordered_map parent_cat_map_t; + typedef std::unordered_map parent_item_map_t; parent_cat_map_t mParentChildCategoryTree; parent_item_map_t mParentChildItemTree; @@ -467,7 +467,7 @@ public: LLInitializedS32& operator++() { ++mValue; return *this; } LLInitializedS32& operator--() { --mValue; return *this; } }; - typedef std::map update_map_t; + typedef std::unordered_map update_map_t; // Call when there are category updates. Call them *before* the // actual update so the method can do descendent accounting correctly. @@ -592,8 +592,8 @@ protected: cat_array_t* getUnlockedCatArray(const LLUUID& id); item_array_t* getUnlockedItemArray(const LLUUID& id); private: - std::map mCategoryLock; - std::map mItemLock; + std::unordered_map mCategoryLock; + std::unordered_map mItemLock; //-------------------------------------------------------------------- // Debugging