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!
This commit is contained in:
Lirusaito
2019-02-28 20:23:21 -05:00
parent 9630632120
commit 1850cd159d

View File

@@ -27,7 +27,7 @@
#ifndef LL_LLINVENTORYMODEL_H
#define LL_LLINVENTORYMODEL_H
#include <map>
#include <unordered_map>
#include <set>
#include <string>
#include <vector>
@@ -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<LLUUID, LLPointer<LLViewerInventoryCategory> > cat_map_t;
typedef std::map<LLUUID, LLPointer<LLViewerInventoryItem> > item_map_t;
typedef std::unordered_map<LLUUID, LLPointer<LLViewerInventoryCategory> > cat_map_t;
typedef std::unordered_map<LLUUID, LLPointer<LLViewerInventoryItem> > 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<LLUUID, cat_array_t*> parent_cat_map_t;
typedef std::map<LLUUID, item_array_t*> parent_item_map_t;
typedef std::unordered_map<LLUUID, cat_array_t*> parent_cat_map_t;
typedef std::unordered_map<LLUUID, item_array_t*> 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<LLUUID, LLInitializedS32> update_map_t;
typedef std::unordered_map<LLUUID, LLInitializedS32> 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<LLUUID, bool> mCategoryLock;
std::map<LLUUID, bool> mItemLock;
std::unordered_map<LLUUID, bool> mCategoryLock;
std::unordered_map<LLUUID, bool> mItemLock;
//--------------------------------------------------------------------
// Debugging