diff --git a/indra/llcharacter/llkeyframemotion.h b/indra/llcharacter/llkeyframemotion.h index c32212db507b17f84616195675a74eb075613725..6f50e363daf3e1ec438285b04e703c53c1892b22 100644 --- a/indra/llcharacter/llkeyframemotion.h +++ b/indra/llcharacter/llkeyframemotion.h @@ -442,7 +442,7 @@ class LLKeyframeDataCache LLKeyframeDataCache(){}; ~LLKeyframeDataCache(); - typedef std::map<LLUUID, class LLKeyframeMotion::JointMotionList*> keyframe_data_map_t; + typedef boost::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 afc5f4875e59fa745df4da9de3e9ea01d40249b6..04bca84af895e69804918d55741fd6e7e7cdd2a5 100644 --- a/indra/llcharacter/llmotioncontroller.cpp +++ b/indra/llcharacter/llmotioncontroller.cpp @@ -206,32 +206,27 @@ void LLMotionController::purgeExcessMotions() } } - std::set<LLUUID> motions_to_kill; + std::vector<LLUUID> motions_to_kill; + motions_to_kill.reserve(100); if (mLoadedMotions.size() > MAX_MOTION_INSTANCES) { // too many motions active this frame, kill all blenders mPoseBlender.clearBlenders(); - for (motion_set_t::iterator loaded_motion_it = mLoadedMotions.begin(); - loaded_motion_it != mLoadedMotions.end(); - ++loaded_motion_it) + for (LLMotion* cur_motionp : mLoadedMotions) { - LLMotion* cur_motionp = *loaded_motion_it; // motion isn't playing, delete it if (!isMotionActive(cur_motionp)) { - motions_to_kill.insert(cur_motionp->getID()); + motions_to_kill.push_back(cur_motionp->getID()); } } } // clean up all inactive, loaded motions - for (std::set<LLUUID>::iterator motion_it = motions_to_kill.begin(); - motion_it != motions_to_kill.end(); - ++motion_it) + for (const LLUUID& motion_id : motions_to_kill) { // look up the motion again by ID to get canonical instance // and kill it only if that one is inactive - LLUUID motion_id = *motion_it; LLMotion* motionp = findMotion(motion_id); if (motionp && !isMotionActive(motionp)) { @@ -563,11 +558,8 @@ void LLMotionController::updateMotionsByType(LLMotion::LLMotionBlendType anim_ty memset(&last_joint_signature, 0, sizeof(U8) * LL_CHARACTER_MAX_ANIMATED_JOINTS); // iterate through active motions in chronological order - for (motion_list_t::iterator iter = mActiveMotions.begin(); - iter != mActiveMotions.end(); ) + for (LLMotion* motionp : mActiveMotions) { - motion_list_t::iterator curiter = iter++; - LLMotion* motionp = *curiter; if (motionp->getBlendType() != anim_type) { continue; @@ -1114,10 +1106,9 @@ void LLMotionController::flushAllMotions() mCharacter->removeAnimationData("Hand Pose"); // restart motions - for (std::vector<std::pair<LLUUID,F32> >::iterator iter = active_motions.begin(); - iter != active_motions.end(); ++iter) + for (const auto& motion_pair : active_motions) { - startMotion(iter->first, iter->second); + startMotion(motion_pair.first, motion_pair.second); } } diff --git a/indra/llcharacter/llmotioncontroller.h b/indra/llcharacter/llmotioncontroller.h index 637ee4d2bba7122dfe749665bfb7de7297ce6ecb..7b5c29699e8e48ccd5a6c964c2595ab6a91cd2bf 100644 --- a/indra/llcharacter/llmotioncontroller.h +++ b/indra/llcharacter/llmotioncontroller.h @@ -40,6 +40,8 @@ #include "llstatemachine.h" #include "llstring.h" +#include <boost/unordered_map.hpp> + //----------------------------------------------------------------------------- // Class predeclaration // This is necessary because llcharacter.h includes this file. @@ -73,7 +75,7 @@ class LLMotionRegistry protected: - typedef std::map<LLUUID, LLMotionConstructor> motion_map_t; + typedef boost::unordered_map<LLUUID, LLMotionConstructor> motion_map_t; motion_map_t mMotionTable; }; @@ -208,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 std::map<LLUUID, LLMotion*> motion_map_t; + typedef boost::unordered_map<LLUUID, LLMotion*> motion_map_t; motion_map_t mAllMotions; motion_set_t mLoadingMotions; diff --git a/indra/llcommon/llerror.cpp b/indra/llcommon/llerror.cpp index 3b793aa23c9993e1231522db4bc9e060658f288d..9e8f94d4cf0db8b181b37d20d3c81a843de25c3a 100644 --- a/indra/llcommon/llerror.cpp +++ b/indra/llcommon/llerror.cpp @@ -41,7 +41,7 @@ # include <unistd.h> #endif // !LL_WINDOWS #include <vector> -#include <unordered_map> +#include <boost/unordered_map.hpp> #include "string.h" #include "llapp.h" @@ -487,7 +487,7 @@ namespace LLError LevelMap mClassLevelMap; LevelMap mFileLevelMap; LevelMap mTagLevelMap; - std::unordered_map<std::string, unsigned int> mUniqueLogMessages; + boost::unordered_map<std::string, unsigned int> mUniqueLogMessages; LLError::FatalFunction mCrashFunction; LLError::TimeFunction mTimeFunction; diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp index 365ffc1184b31a37f28fc55b592463ca23935e82..d46d54ee2b7706648f51290cd1a3ffd162e1bfce 100644 --- a/indra/newview/llviewerobjectlist.cpp +++ b/indra/newview/llviewerobjectlist.cpp @@ -98,8 +98,8 @@ extern LLPipeline gPipeline; // Statics for object lookup tables. U32 LLViewerObjectList::sSimulatorMachineIndex = 1; // Not zero deliberately, to speed up index check. -std::unordered_map<U64, U32> LLViewerObjectList::sIPAndPortToIndex; -std::unordered_map<U64, LLUUID> LLViewerObjectList::sIndexAndLocalIDToUUID; +boost::unordered_map<U64, U32> LLViewerObjectList::sIPAndPortToIndex; +boost::unordered_map<U64, LLUUID> LLViewerObjectList::sIndexAndLocalIDToUUID; LLViewerObjectList::LLViewerObjectList() { diff --git a/indra/newview/llviewerobjectlist.h b/indra/newview/llviewerobjectlist.h index 5ac11271c490f13c38008fbc0fa1b6a5f017050e..9f775ef6ac199a35b2165bf2552bb82c00fe8d5a 100644 --- a/indra/newview/llviewerobjectlist.h +++ b/indra/newview/llviewerobjectlist.h @@ -40,7 +40,7 @@ #include "llcoros.h" // system includes -#include <unordered_map> +#include <boost/unordered_map.hpp> class LLCamera; class LLNetMap; @@ -213,7 +213,7 @@ class LLViewerObjectList uuid_set_t mDeadObjects; - std::unordered_map<LLUUID, LLPointer<LLViewerObject> > mUUIDObjectMap; + boost::unordered_map<LLUUID, LLPointer<LLViewerObject> > mUUIDObjectMap; //set of objects that need to update their cost uuid_set_t mStaleObjectCost; @@ -228,9 +228,9 @@ class LLViewerObjectList S32 mCurLazyUpdateIndex; static U32 sSimulatorMachineIndex; - static std::unordered_map<U64, U32> sIPAndPortToIndex; + static boost::unordered_map<U64, U32> sIPAndPortToIndex; - static std::unordered_map<U64, LLUUID> sIndexAndLocalIDToUUID; + static boost::unordered_map<U64, LLUUID> sIndexAndLocalIDToUUID; std::set<LLViewerObject *> mSelectPickList;