Commit a637f6c3 authored by Rye Mutt's avatar Rye Mutt 🍞
Browse files

Reduce string copies

parent 684623bd
......@@ -1322,7 +1322,7 @@ LLJoint* LLAvatarAppearance::findCollisionVolume(S32 volume_id)
//-----------------------------------------------------------------------------
// findCollisionVolume()
//-----------------------------------------------------------------------------
S32 LLAvatarAppearance::getCollisionVolumeID(std::string &name)
S32 LLAvatarAppearance::getCollisionVolumeID(const std::string &name)
{
for (S32 i = 0; i < mNumCollisionVolumes; i++)
{
......
......@@ -95,7 +95,7 @@ public:
/*virtual*/ const char* getAnimationPrefix() override { return "avatar"; }
/*virtual*/ LLVector3 getVolumePos(S32 joint_index, LLVector3& volume_offset) override;
/*virtual*/ LLJoint* findCollisionVolume(S32 volume_id) override;
/*virtual*/ S32 getCollisionVolumeID(std::string &name) override;
/*virtual*/ S32 getCollisionVolumeID(const std::string &name) override;
/*virtual*/ LLPolyMesh* getHeadMesh() override;
/*virtual*/ LLPolyMesh* getUpperBodyMesh() override;
......
......@@ -182,7 +182,7 @@ public:
virtual LLJoint* findCollisionVolume(S32 volume_id) { return nullptr; }
virtual S32 getCollisionVolumeID(std::string &name) { return -1; }
virtual S32 getCollisionVolumeID(const std::string &name) { return -1; }
void setAnimationData(const std::string& name, void *data);
......
......@@ -333,7 +333,7 @@ namespace LLInitParam
}
}
return "";
return std::string();
}
void clearValueName() const
......
......@@ -134,7 +134,7 @@ public:
void draw() override;
const std::string getLabel() const { return wstring_to_utf8str(mLabel); }
const std::string& getLabel() const { return mLabel.getString(); }
void setLabel( const LLStringExplicit& label);
void setDrawAtParentTop(bool draw_at_top) { mDrawAtParentTop = draw_at_top;}
......
......@@ -199,7 +199,7 @@ public:
void setText(const LLStringExplicit &new_text);
const std::string& getText() const { return mText.getString(); }
LLWString getWText() const { return mText.getWString(); }
const LLWString& getWText() const { return mText.getWString(); }
LLWString getConvertedText() const; // trimmed text with paragraphs converted to newlines
S32 getLength() const { return mText.length(); }
......
......@@ -114,7 +114,7 @@ public:
// change the label
void setLabel( const LLStringExplicit& label ) { mLabel = label; }
std::string getLabel( void ) const { return mLabel.getString(); }
const std::string& getLabel( void ) const { return mLabel.getString(); }
BOOL setLabelArg( const std::string& key, const LLStringExplicit& text ) override;
// Get the parent menu for this item
......
......@@ -151,9 +151,9 @@ public:
void setDefaultBtn(const std::string& id);
void updateDefaultBtn();
void setLabel(const LLStringExplicit& label) { mLabel = label; }
std::string getLabel() const { return mLabel; }
const std::string& getLabel() const { return mLabel.getString(); }
void setHelpTopic(const std::string& help_topic) { mHelpTopic = help_topic; }
std::string getHelpTopic() const { return mHelpTopic; }
const std::string& getHelpTopic() const { return mHelpTopic; }
void setCtrlsEnabled(BOOL b);
ctrl_list_t getCtrlList() const;
......
......@@ -319,7 +319,7 @@ public:
virtual LLRect getSnapRect() const;
LLRect getLocalSnapRect() const;
std::string getLayout() { return mLayout; }
const std::string& getLayout() { return mLayout; }
// Override and return required size for this object. 0 for width/height means don't care.
virtual LLRect getRequiredRect();
......
......@@ -583,7 +583,7 @@ public:
BOOL getAutoPilotUseRotation() const { return mAutoPilotUseRotation; }
LLVector3 getAutoPilotTargetFacing() const { return mAutoPilotTargetFacing; }
F32 getAutoPilotRotationThreshold() const { return mAutoPilotRotationThreshold; }
std::string getAutoPilotBehaviorName() const { return mAutoPilotBehaviorName; }
const std::string& getAutoPilotBehaviorName() const { return mAutoPilotBehaviorName; }
void startAutoPilotGlobal(const LLVector3d &pos_global,
const std::string& behavior_name = std::string(),
......
......@@ -2308,7 +2308,7 @@ void LLAppearanceMgr::createBaseOutfitLink(const LLUUID& category, LLPointer<LLI
{
const LLUUID cof = getCOF();
LLViewerInventoryCategory* catp = gInventory.getCategory(category);
std::string new_outfit_name = "";
std::string new_outfit_name;
purgeBaseOutfitLink(cof, link_waiter);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment