From 42897ee2c8adc3dc314b38aeb1156e2a2db62417 Mon Sep 17 00:00:00 2001
From: Rye Mutt <rye@alchemyviewer.org>
Date: Tue, 21 Jul 2020 04:28:52 -0400
Subject: [PATCH] Use robin_hood hashmaps for character data updates

---
 indra/llappearance/llavatarappearance.h  | 4 +++-
 indra/llcharacter/llanimationstates.h    | 4 ++--
 indra/llcharacter/llcharacter.h          | 4 ++--
 indra/llcharacter/llkeyframemotion.cpp   | 2 +-
 indra/llcharacter/llkeyframemotion.h     | 4 +++-
 indra/llcharacter/llmotioncontroller.cpp | 2 +-
 indra/llcharacter/llmotioncontroller.h   | 6 +++---
 7 files changed, 15 insertions(+), 11 deletions(-)

diff --git a/indra/llappearance/llavatarappearance.h b/indra/llappearance/llavatarappearance.h
index 5aff01e859e..47098bee21f 100644
--- a/indra/llappearance/llavatarappearance.h
+++ b/indra/llappearance/llavatarappearance.h
@@ -35,6 +35,8 @@
 #include "llviewervisualparam.h"
 #include "llxmltree.h"
 
+#include <robin_hood.h>
+
 class LLTexLayerSet;
 class LLTexGlobalColor;
 class LLTexGlobalColorInfo;
@@ -138,7 +140,7 @@ class LLAvatarAppearance : public LLCharacter
 	LLVector3			mHeadOffset; // current head position
 	LLAvatarJoint		*mRoot;
 
-	typedef boost::unordered_map<std::string, LLJoint*> joint_map_t;
+	typedef robin_hood::unordered_map<std::string, LLJoint*> joint_map_t;
 	joint_map_t			mJointMap;
 
     typedef std::map<std::string, LLVector3> joint_state_map_t;
diff --git a/indra/llcharacter/llanimationstates.h b/indra/llcharacter/llanimationstates.h
index 1b13a0bf544..32693d66e1f 100644
--- a/indra/llcharacter/llanimationstates.h
+++ b/indra/llcharacter/llanimationstates.h
@@ -28,7 +28,7 @@
 #define LL_LLANIMATIONSTATES_H
 
 #include <map>
-#include <boost/unordered_map.hpp>
+#include <robin_hood.h>
 
 #include "llstringtable.h"
 #include "lluuid.h"
@@ -204,7 +204,7 @@ class LLAnimationLibrary
 private:
 	LLStringTable mAnimStringTable;
 
-	typedef boost::unordered_map<LLUUID, char *> anim_map_t;
+	typedef robin_hood::unordered_map<LLUUID, char *> anim_map_t;
 	anim_map_t mAnimMap;
 
 public:
diff --git a/indra/llcharacter/llcharacter.h b/indra/llcharacter/llcharacter.h
index f30db74676d..04a76e725c4 100644
--- a/indra/llcharacter/llcharacter.h
+++ b/indra/llcharacter/llcharacter.h
@@ -39,7 +39,7 @@
 #include "llpointer.h"
 #include "llrefcount.h"
 
-#include <boost/unordered_map.hpp>
+#include <robin_hood.h>
 
 class LLPolyMesh;
 
@@ -268,7 +268,7 @@ class LLCharacter
 protected:
 	LLMotionController	mMotionController;
 
-	typedef boost::unordered_map<std::string, void *> animation_data_map_t;
+	typedef robin_hood::unordered_map<std::string, void *> animation_data_map_t;
 	animation_data_map_t mAnimationData;
 
 	F32					mPreferredPelvisHeight;
diff --git a/indra/llcharacter/llkeyframemotion.cpp b/indra/llcharacter/llkeyframemotion.cpp
index c50ff37e1ba..f06e42fd141 100644
--- a/indra/llcharacter/llkeyframemotion.cpp
+++ b/indra/llcharacter/llkeyframemotion.cpp
@@ -2452,7 +2452,7 @@ LLKeyframeDataCache::~LLKeyframeDataCache()
 //-----------------------------------------------------------------------------
 void LLKeyframeDataCache::clear()
 {
-	for_each(sKeyframeDataMap.begin(), sKeyframeDataMap.end(), DeletePairedPointer());
+	std::for_each(sKeyframeDataMap.begin(), sKeyframeDataMap.end(), DeletePairedPointer());
 	sKeyframeDataMap.clear();
 }
 
diff --git a/indra/llcharacter/llkeyframemotion.h b/indra/llcharacter/llkeyframemotion.h
index 6f50e363daf..675d0c44089 100644
--- a/indra/llcharacter/llkeyframemotion.h
+++ b/indra/llcharacter/llkeyframemotion.h
@@ -43,6 +43,8 @@
 #include "v3math.h"
 #include "llbvhconsts.h"
 
+#include <robin_hood.h>
+
 class LLKeyframeDataCache;
 class LLVFS;
 class LLDataPacker;
@@ -442,7 +444,7 @@ class LLKeyframeDataCache
 	LLKeyframeDataCache(){};
 	~LLKeyframeDataCache();
 
-	typedef boost::unordered_map<LLUUID, class LLKeyframeMotion::JointMotionList*> keyframe_data_map_t; 
+	typedef robin_hood::unordered_map<LLUUID, class LLKeyframeMotion::JointMotionList*> keyframe_data_map_t; 
 	static keyframe_data_map_t sKeyframeDataMap;
 
 	static void addKeyframeData(const LLUUID& id, LLKeyframeMotion::JointMotionList*);
diff --git a/indra/llcharacter/llmotioncontroller.cpp b/indra/llcharacter/llmotioncontroller.cpp
index 41f372d09f9..5097d2d6033 100644
--- a/indra/llcharacter/llmotioncontroller.cpp
+++ b/indra/llcharacter/llmotioncontroller.cpp
@@ -172,7 +172,7 @@ void LLMotionController::deleteAllMotions()
 	mLoadedMotions.clear();
 	mActiveMotions.clear();
 
-	for_each(mAllMotions.begin(), mAllMotions.end(), DeletePairedPointer());
+	std::for_each(mAllMotions.begin(), mAllMotions.end(), DeletePairedPointer());
 	mAllMotions.clear();
 
 	// stinson 05/12/20014 : Ownership of the LLMotion pointers is transferred from
diff --git a/indra/llcharacter/llmotioncontroller.h b/indra/llcharacter/llmotioncontroller.h
index 7b5c29699e8..51db86f73ff 100644
--- a/indra/llcharacter/llmotioncontroller.h
+++ b/indra/llcharacter/llmotioncontroller.h
@@ -40,7 +40,7 @@
 #include "llstatemachine.h"
 #include "llstring.h"
 
-#include <boost/unordered_map.hpp>
+#include <robin_hood.h>
 
 //-----------------------------------------------------------------------------
 // Class predeclaration
@@ -75,7 +75,7 @@ class LLMotionRegistry
 
 
 protected:
-	typedef boost::unordered_map<LLUUID, LLMotionConstructor> motion_map_t;
+	typedef robin_hood::unordered_map<LLUUID, LLMotionConstructor> motion_map_t;
 	motion_map_t mMotionTable;
 };
 
@@ -210,7 +210,7 @@ class LLMotionController
 //	Once an animations is loaded, it will be initialized and put on the mLoadedMotions list.
 //	Any animation that is currently playing also sits in the mActiveMotions list.
 
-	typedef boost::unordered_map<LLUUID, LLMotion*> motion_map_t;
+	typedef robin_hood::unordered_map<LLUUID, LLMotion*> motion_map_t;
 	motion_map_t	mAllMotions;
 
 	motion_set_t		mLoadingMotions;
-- 
GitLab