Boost unordered containers in places, like for uuid types!

This commit is contained in:
Lirusaito
2019-04-04 22:22:21 -04:00
parent a1d06e682e
commit a3bf40fd69
13 changed files with 20 additions and 18 deletions

View File

@@ -31,6 +31,7 @@
#include <vector> #include <vector>
#include <functional> #include <functional>
#include <boost/functional/hash.hpp> #include <boost/functional/hash.hpp>
#include <boost/unordered_set.hpp>
#include "stdtypes.h" #include "stdtypes.h"
#include "llpreprocessor.h" #include "llpreprocessor.h"
@@ -289,7 +290,7 @@ inline U32 LLUUID::getCRC32() const
} }
typedef std::vector<LLUUID> uuid_vec_t; typedef std::vector<LLUUID> uuid_vec_t;
typedef std::set<LLUUID> uuid_set_t; typedef boost::unordered_set<LLUUID> uuid_set_t;
// Helper structure for ordering lluuids in stl containers. eg: // Helper structure for ordering lluuids in stl containers. eg:
// std::map<LLUUID, LLWidget*, lluuid_less> widget_map; // std::map<LLUUID, LLWidget*, lluuid_less> widget_map;

View File

@@ -38,6 +38,7 @@
#include "lluuid.h" #include "lluuid.h"
#include "llstring.h" #include "llstring.h"
#include "llframetimer.h" #include "llframetimer.h"
#include <boost/unordered_map.hpp>
class LLTextBox; class LLTextBox;
class LLScrollListCtrl; class LLScrollListCtrl;
@@ -92,7 +93,7 @@ private:
LLUUID group_id; LLUUID group_id;
}; };
uuid_set_t mPendingObjects; uuid_set_t mPendingObjects;
std::map<LLUUID, ObjectData> mCachedObjects; boost::unordered_map<LLUUID, ObjectData> mCachedObjects;
std::string mFilterStrings[LIST_OBJECT_COUNT]; std::string mFilterStrings[LIST_OBJECT_COUNT];
}; };

View File

@@ -641,7 +641,7 @@ namespace action_give_inventory
return acceptable; return acceptable;
} }
static void build_items_string(const boost::unordered_set<LLUUID>& inventory_selected_uuids, std::string& items_string) static void build_items_string(const uuid_set_t& inventory_selected_uuids, std::string& items_string)
{ {
llassert(inventory_selected_uuids.size() > 0); llassert(inventory_selected_uuids.size() > 0);
@@ -836,10 +836,10 @@ void LLAvatarActions::buildResidentsString(const uuid_vec_t& avatar_uuids, std::
} }
//static //static
boost::unordered_set<LLUUID> LLAvatarActions::getInventorySelectedUUIDs() uuid_set_t LLAvatarActions::getInventorySelectedUUIDs()
{ {
LLInventoryPanel* active_panel = action_give_inventory::get_active_inventory_panel(); LLInventoryPanel* active_panel = action_give_inventory::get_active_inventory_panel();
return active_panel ? active_panel->getRootFolder()->getSelectionList() : boost::unordered_set<LLUUID>(); return active_panel ? active_panel->getRootFolder()->getSelectionList() : uuid_set_t();
/*std::set<LLFolderViewItem*> inventory_selected; /*std::set<LLFolderViewItem*> inventory_selected;
LLInventoryPanel* active_panel = action_give_inventory::get_active_inventory_panel(); LLInventoryPanel* active_panel = action_give_inventory::get_active_inventory_panel();
@@ -857,7 +857,7 @@ boost::unordered_set<LLUUID> LLAvatarActions::getInventorySelectedUUIDs()
} }
} }
boost::unordered_set<LLUUID> inventory_selected_uuids; uuid_set_t inventory_selected_uuids;
for (auto it = inventory_selected.begin(), end_it = inventory_selected.end(); for (auto it = inventory_selected.begin(), end_it = inventory_selected.end();
it != end_it; it != end_it;
++it) ++it)

View File

@@ -234,7 +234,7 @@ public:
*/ */
static void buildResidentsString(const uuid_vec_t& avatar_uuids, std::string& residents_string); static void buildResidentsString(const uuid_vec_t& avatar_uuids, std::string& residents_string);
static boost::unordered_set<LLUUID> getInventorySelectedUUIDs(); static uuid_set_t getInventorySelectedUUIDs();
/** /**
* Copy the selected avatar's UUID to clipboard * Copy the selected avatar's UUID to clipboard

View File

@@ -23,7 +23,7 @@ LLFloaterBlacklist* LLFloaterBlacklist::sInstance;
uuid_vec_t LLFloaterBlacklist::blacklist_textures; uuid_vec_t LLFloaterBlacklist::blacklist_textures;
uuid_vec_t LLFloaterBlacklist::blacklist_objects; uuid_vec_t LLFloaterBlacklist::blacklist_objects;
std::map<LLUUID,LLSD> LLFloaterBlacklist::blacklist_entries; boost::unordered_map<LLUUID,LLSD> LLFloaterBlacklist::blacklist_entries;
LLFloaterBlacklist::LLFloaterBlacklist() LLFloaterBlacklist::LLFloaterBlacklist()
: LLFloater() : LLFloater()

View File

@@ -28,7 +28,7 @@ public:
*/ */
static void addEntry(LLUUID key, LLSD data); static void addEntry(LLUUID key, LLSD data);
static std::map<LLUUID,LLSD> blacklist_entries; static boost::unordered_map<LLUUID,LLSD> blacklist_entries;
static uuid_vec_t blacklist_textures; static uuid_vec_t blacklist_textures;
static uuid_vec_t blacklist_objects; static uuid_vec_t blacklist_objects;

View File

@@ -865,9 +865,9 @@ void LLFolderView::clearSelection()
mSelectThisID.setNull(); mSelectThisID.setNull();
} }
boost::unordered_set<LLUUID> LLFolderView::getSelectionList() const uuid_set_t LLFolderView::getSelectionList() const
{ {
boost::unordered_set<LLUUID> selection; uuid_set_t selection;
for (const auto& item : mSelectedItems) for (const auto& item : mSelectedItems)
{ {
selection.insert(item->getListener()->getUUID()); selection.insert(item->getListener()->getUUID());

View File

@@ -160,7 +160,7 @@ public:
// children, and keeps track of selected objects. // children, and keeps track of selected objects.
virtual BOOL changeSelection(LLFolderViewItem* selection, BOOL selected); virtual BOOL changeSelection(LLFolderViewItem* selection, BOOL selected);
virtual boost::unordered_set<LLUUID> getSelectionList() const; virtual uuid_set_t getSelectionList() const;
// Make sure if ancestor is selected, descendants are not // Make sure if ancestor is selected, descendants are not
void sanitizeSelection(); void sanitizeSelection();

View File

@@ -378,9 +378,9 @@ void LLFolderViewItem::setSelectionFromRoot(LLFolderViewItem* selection,
getRoot()->setSelection(selection, openitem, take_keyboard_focus); getRoot()->setSelection(selection, openitem, take_keyboard_focus);
} }
boost::unordered_set<LLUUID> LLFolderViewItem::getSelectionList() const uuid_set_t LLFolderViewItem::getSelectionList() const
{ {
return boost::unordered_set<LLUUID>(); return uuid_set_t();
} }
EInventorySortGroup LLFolderViewItem::getSortGroup() const EInventorySortGroup LLFolderViewItem::getSortGroup() const

View File

@@ -220,7 +220,7 @@ public:
virtual void selectItem(); virtual void selectItem();
// gets multiple-element selection // gets multiple-element selection
virtual boost::unordered_set<LLUUID> getSelectionList() const; virtual uuid_set_t getSelectionList() const;
// Returns true is this object and all of its children can be removed (deleted by user) // Returns true is this object and all of its children can be removed (deleted by user)
virtual BOOL isRemovable(); virtual BOOL isRemovable();

View File

@@ -186,7 +186,7 @@ private:
std::vector<LLMultiGesture*> mPlaying; std::vector<LLMultiGesture*> mPlaying;
bool mValid; bool mValid;
boost::unordered_set<LLUUID> mLoadingAssets; uuid_set_t mLoadingAssets;
}; };
#endif #endif

View File

@@ -1710,7 +1710,7 @@ void LLPanelObjectInventory::updateInventory()
// << " panel UUID: " << panel->mTaskUUID << "\n" // << " panel UUID: " << panel->mTaskUUID << "\n"
// << " task UUID: " << object->mID << LL_ENDL; // << " task UUID: " << object->mID << LL_ENDL;
// We're still interested in this task's inventory. // We're still interested in this task's inventory.
boost::unordered_set<LLUUID> selected_items; uuid_set_t selected_items;
BOOL inventory_has_focus = FALSE; BOOL inventory_has_focus = FALSE;
if (mHaveInventory) if (mHaveInventory)
{ {

View File

@@ -212,7 +212,7 @@ private:
std::string mFolder; std::string mFolder;
// Export texture list // Export texture list
typedef boost::unordered_set<LLUUID> textures_set_t; typedef uuid_set_t textures_set_t;
textures_set_t mTexturesList; textures_set_t mTexturesList;
textures_set_t mBadPermsTexturesList; textures_set_t mBadPermsTexturesList;