Replace (at least) our use of boost::unordered_map with std::unordered_map

meow-7.2.2
Ansariel 2023-12-04 13:42:09 +01:00
parent dbd2cc7f32
commit 2fc942a75c
4 changed files with 12 additions and 17 deletions

View File

@ -142,7 +142,7 @@ public:
// <FS:ND> This map gets queried a huge amount of time.
// typedef std::map<std::string, LLJoint*> joint_map_t;
typedef boost::unordered_map< U32, LLJoint*> joint_map_t;
typedef std::unordered_map<U32, LLJoint*> joint_map_t;
// </FS:ND>
joint_map_t mJointMap;

View File

@ -36,24 +36,20 @@
#include <boost/algorithm/string.hpp>
//<FS:ND> Query by JointKey rather than just a string, the key can be a U32 index for faster lookup
#include <boost/unordered_map.hpp>
#include <unordered_map>
boost::unordered_map< std::string, U32 > mpStringToKeys;
std::unordered_map<std::string, U32> mpStringToKeys;
JointKey JointKey::construct( std::string aName )
JointKey JointKey::construct(const std::string& aName)
{
boost::unordered_map< std::string, U32 >::iterator itr = mpStringToKeys.find( aName );
if( mpStringToKeys.end() == itr )
if (const auto itr = mpStringToKeys.find(aName); itr != mpStringToKeys.end())
{
U32 size = mpStringToKeys.size() + 1;
JointKey key{ aName, size };
mpStringToKeys[ aName ] = size;
return key;
return { aName, itr->second };
}
return JointKey{ aName, itr->second };
U32 size = mpStringToKeys.size() + 1;
mpStringToKeys.try_emplace(aName, size);
return { aName, size };
}
// </FS:ND>

View File

@ -46,7 +46,7 @@ struct JointKey
std::string mName;
U32 mKey;
static JointKey construct( std::string aName );
static JointKey construct(const std::string& aName);
};
inline bool operator==(JointKey const &aLHS, JointKey const &aRHS)
@ -63,7 +63,6 @@ inline std::ostream& operator<<(std::ostream &aLHS, JointKey const &aRHS)
{
return aLHS << aRHS.mName << " (" << aRHS.mKey << ")";
}
// </FS:ND>
const S32 LL_CHARACTER_MAX_JOINTS_PER_MESH = 15;

View File

@ -29,7 +29,7 @@
#include "llpanelgroup.h"
#include <boost/unordered_map.hpp>
#include <unordered_map>
class LLLineEditor;
class LLTextBox;
@ -127,7 +127,7 @@ private:
S32 sortMembersList(S32,const LLScrollListItem*,const LLScrollListItem*);
LLGroupMgrGroupData::member_list_t::iterator mMemberProgress;
typedef boost::unordered_map<LLUUID, boost::signals2::connection, FSUUIDHash> avatar_name_cache_connection_map_t;
typedef std::unordered_map<LLUUID, boost::signals2::connection, FSUUIDHash> avatar_name_cache_connection_map_t;
avatar_name_cache_connection_map_t mAvatarNameCacheConnections;
BOOL mPendingMemberUpdate;