From 90e9bce8deacba2c7722943657dd7f74c8b44547 Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Wed, 27 Mar 2019 22:28:29 -0400 Subject: [PATCH] Boost::unordered is better than std::unordered, apparently --- indra/llcharacter/llmultigesture.h | 6 +++--- indra/newview/llavataractions.cpp | 8 ++++---- indra/newview/llavataractions.h | 4 ++-- indra/newview/llfolderview.cpp | 4 ++-- indra/newview/llfolderview.h | 6 ++++-- indra/newview/llfolderviewitem.cpp | 4 ++-- indra/newview/llfolderviewitem.h | 5 ++--- indra/newview/llgesturemgr.h | 10 +++++----- indra/newview/llinventorymodel.h | 16 ++++++++-------- indra/newview/llinventoryobserver.h | 4 ++-- indra/newview/llinventorypanel.h | 2 +- indra/newview/llpanelobjectinventory.cpp | 2 +- indra/newview/llviewermessage.cpp | 2 +- 13 files changed, 37 insertions(+), 36 deletions(-) diff --git a/indra/llcharacter/llmultigesture.h b/indra/llcharacter/llmultigesture.h index e7a5fda15..60cdb2f59 100644 --- a/indra/llcharacter/llmultigesture.h +++ b/indra/llcharacter/llmultigesture.h @@ -27,7 +27,7 @@ #ifndef LL_LLMULTIGESTURE_H #define LL_LLMULTIGESTURE_H -#include +#include #include #include @@ -100,11 +100,11 @@ public: std::function mDoneCallback; // Animations that we requested to start - std::unordered_set mRequestedAnimIDs; + boost::unordered_set mRequestedAnimIDs; // Once the animation starts playing (sim says to start playing) // the ID is moved from mRequestedAnimIDs to here. - std::unordered_set mPlayingAnimIDs; + boost::unordered_set mPlayingAnimIDs; }; diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index 0a6b4db21..db20a0983 100644 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -643,7 +643,7 @@ namespace action_give_inventory return acceptable; } - static void build_items_string(const std::unordered_set& inventory_selected_uuids, std::string& items_string) + static void build_items_string(const boost::unordered_set& inventory_selected_uuids, std::string& items_string) { llassert(inventory_selected_uuids.size() > 0); @@ -838,10 +838,10 @@ void LLAvatarActions::buildResidentsString(const uuid_vec_t& avatar_uuids, std:: } //static -std::unordered_set LLAvatarActions::getInventorySelectedUUIDs() +boost::unordered_set LLAvatarActions::getInventorySelectedUUIDs() { LLInventoryPanel* active_panel = action_give_inventory::get_active_inventory_panel(); - return active_panel ? active_panel->getRootFolder()->getSelectionList() : std::unordered_set(); + return active_panel ? active_panel->getRootFolder()->getSelectionList() : boost::unordered_set(); /*std::set inventory_selected; LLInventoryPanel* active_panel = action_give_inventory::get_active_inventory_panel(); @@ -859,7 +859,7 @@ std::unordered_set LLAvatarActions::getInventorySelectedUUIDs() } } - std::unordered_set inventory_selected_uuids; + boost::unordered_set inventory_selected_uuids; for (auto it = inventory_selected.begin(), end_it = inventory_selected.end(); it != end_it; ++it) diff --git a/indra/newview/llavataractions.h b/indra/newview/llavataractions.h index 2c3199942..2f597005e 100644 --- a/indra/newview/llavataractions.h +++ b/indra/newview/llavataractions.h @@ -27,7 +27,7 @@ #ifndef LL_LLAVATARACTIONS_H #define LL_LLAVATARACTIONS_H -#include +#include class LLAvatarName; class LLInventoryPanel; @@ -234,7 +234,7 @@ public: */ static void buildResidentsString(const uuid_vec_t& avatar_uuids, std::string& residents_string); - static std::unordered_set getInventorySelectedUUIDs(); + static boost::unordered_set getInventorySelectedUUIDs(); /** * Copy the selected avatar's UUID to clipboard diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index 789da8b82..22b37e571 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -865,9 +865,9 @@ void LLFolderView::clearSelection() mSelectThisID.setNull(); } -std::unordered_set LLFolderView::getSelectionList() const +boost::unordered_set LLFolderView::getSelectionList() const { - std::unordered_set selection; + boost::unordered_set selection; for (const auto& item : mSelectedItems) { selection.insert(item->getListener()->getUUID()); diff --git a/indra/newview/llfolderview.h b/indra/newview/llfolderview.h index 407c23d4f..c85238f50 100644 --- a/indra/newview/llfolderview.h +++ b/indra/newview/llfolderview.h @@ -54,6 +54,8 @@ #include "lltooldraganddrop.h" #include "llviewertexture.h" +#include + class LLFolderViewEventListener; class LLFolderViewGroupedItemModel; class LLFolderViewFolder; @@ -158,7 +160,7 @@ public: // children, and keeps track of selected objects. virtual BOOL changeSelection(LLFolderViewItem* selection, BOOL selected); - virtual std::unordered_set getSelectionList() const; + virtual boost::unordered_set getSelectionList() const; // Make sure if ancestor is selected, descendants are not void sanitizeSelection(); @@ -330,7 +332,7 @@ protected: S32 mSignalSelectCallback; S32 mMinWidth; S32 mRunningHeight; - std::unordered_map mItemMap; + boost::unordered_map mItemMap; LLUUID mSelectThisID; // if non null, select this item LLHandle mParentPanel; diff --git a/indra/newview/llfolderviewitem.cpp b/indra/newview/llfolderviewitem.cpp index 799545f4d..ddf0780a4 100644 --- a/indra/newview/llfolderviewitem.cpp +++ b/indra/newview/llfolderviewitem.cpp @@ -378,9 +378,9 @@ void LLFolderViewItem::setSelectionFromRoot(LLFolderViewItem* selection, getRoot()->setSelection(selection, openitem, take_keyboard_focus); } -std::unordered_set LLFolderViewItem::getSelectionList() const +boost::unordered_set LLFolderViewItem::getSelectionList() const { - return std::unordered_set(); + return boost::unordered_set(); } EInventorySortGroup LLFolderViewItem::getSortGroup() const diff --git a/indra/newview/llfolderviewitem.h b/indra/newview/llfolderviewitem.h index 0eac95f3d..655e23e89 100644 --- a/indra/newview/llfolderviewitem.h +++ b/indra/newview/llfolderviewitem.h @@ -30,8 +30,7 @@ #include "lluiimage.h" #include "lluictrl.h" -#include -#include +#include class LLFontGL; class LLFolderView; @@ -221,7 +220,7 @@ public: virtual void selectItem(); // gets multiple-element selection - virtual std::unordered_set getSelectionList() const; + virtual boost::unordered_set getSelectionList() const; // Returns true is this object and all of its children can be removed (deleted by user) virtual BOOL isRemovable(); diff --git a/indra/newview/llgesturemgr.h b/indra/newview/llgesturemgr.h index 4eef5275f..56ad7f097 100644 --- a/indra/newview/llgesturemgr.h +++ b/indra/newview/llgesturemgr.h @@ -28,8 +28,8 @@ #define LL_LLGESTUREMGR_H #include -#include -#include +#include +#include #include #include "llassetstorage.h" // LLAssetType @@ -56,8 +56,8 @@ public: typedef std::function gesture_loaded_callback_t; // Maps inventory item_id to gesture - typedef std::unordered_map item_map_t; - typedef std::unordered_map callback_map_t; + typedef boost::unordered_map item_map_t; + typedef boost::unordered_map callback_map_t; LLGestureMgr(); ~LLGestureMgr(); @@ -186,7 +186,7 @@ private: std::vector mPlaying; bool mValid; - std::unordered_set mLoadingAssets; + boost::unordered_set mLoadingAssets; }; #endif diff --git a/indra/newview/llinventorymodel.h b/indra/newview/llinventorymodel.h index 915dbc296..7e896b7cb 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::unordered_map > cat_map_t; - typedef std::unordered_map > item_map_t; + typedef boost::unordered_map > cat_map_t; + typedef boost::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::unordered_map parent_cat_map_t; - typedef std::unordered_map parent_item_map_t; + typedef boost::unordered_map parent_cat_map_t; + typedef boost::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::unordered_map update_map_t; + typedef boost::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::unordered_map mCategoryLock; - std::unordered_map mItemLock; + boost::unordered_map mCategoryLock; + boost::unordered_map mItemLock; //-------------------------------------------------------------------- // Debugging diff --git a/indra/newview/llinventoryobserver.h b/indra/newview/llinventoryobserver.h index c465d2f57..d420490a8 100644 --- a/indra/newview/llinventoryobserver.h +++ b/indra/newview/llinventoryobserver.h @@ -30,7 +30,7 @@ #include "lluuid.h" #include "llmd5.h" #include -#include +#include #include class LLViewerInventoryCategory; @@ -285,7 +285,7 @@ protected: LLUUID mCatID; }; - typedef std::unordered_map category_map_t; + typedef boost::unordered_map category_map_t; typedef category_map_t::value_type category_map_value_t; category_map_t mCategoryMap; diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h index 3912bf5bc..524710b67 100644 --- a/indra/newview/llinventorypanel.h +++ b/indra/newview/llinventorypanel.h @@ -211,7 +211,7 @@ protected: LLScrollContainer* mScroller; LLPointer mGroupedItemBridge; - std::unordered_map mItemMap; + boost::unordered_map mItemMap; /** * Pointer to LLInventoryFolderViewModelBuilder. * diff --git a/indra/newview/llpanelobjectinventory.cpp b/indra/newview/llpanelobjectinventory.cpp index c47c8a2b3..da0773f5a 100644 --- a/indra/newview/llpanelobjectinventory.cpp +++ b/indra/newview/llpanelobjectinventory.cpp @@ -1710,7 +1710,7 @@ void LLPanelObjectInventory::updateInventory() // << " panel UUID: " << panel->mTaskUUID << "\n" // << " task UUID: " << object->mID << LL_ENDL; // We're still interested in this task's inventory. - std::unordered_set selected_items; + boost::unordered_set selected_items; BOOL inventory_has_focus = FALSE; if (mHaveInventory) { diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 0ab64e9ab..8df492288 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -881,7 +881,7 @@ private: } LLHandle mActivePanel; - typedef std::unordered_set selected_items_t; + typedef boost::unordered_set selected_items_t; selected_items_t mSelectedItems; /**