Commit 494d7673 authored by Rye Mutt's avatar Rye Mutt 🍞
Browse files

Reduce copies with const refs and moves in various ll libs

parent 5dc32ae2
......@@ -294,7 +294,7 @@ struct MeasureMem<T*, IS_MEM_TRACKABLE, IS_BYTES>
template<typename T, typename IS_MEM_TRACKABLE, typename IS_BYTES>
struct MeasureMem<LLPointer<T>, IS_MEM_TRACKABLE, IS_BYTES>
{
static size_t measureFootprint(const LLPointer<T> value)
static size_t measureFootprint(const LLPointer<T>& value)
{
if (value.isNull())
{
......
......@@ -57,7 +57,8 @@ public:
explicit LLUUID(const char *in_string); // Convert from string.
explicit LLUUID(const std::string& in_string); // Convert from string.
LLUUID(const LLUUID &rhs) = default;
LLUUID &operator=(const LLUUID &rhs) = default;
LLUUID& operator=(const LLUUID& rhs) = default;
LLUUID& operator=(LLUUID&& rhs) = default;
~LLUUID() = default;
//
......
......@@ -582,7 +582,7 @@ public:
void setRegionAllowAccessOverride(BOOL override) { mRegionAllowAccessoverride = override; }
// Accessors for parcel sellWithObjects
void setPreviousOwnerID(LLUUID prev_owner) { mPreviousOwnerID = prev_owner; }
void setPreviousOwnerID(const LLUUID& prev_owner) { mPreviousOwnerID = prev_owner; }
void setPreviouslyGroupOwned(BOOL b) { mPreviouslyGroupOwned = b; }
void setSellWithObjects(BOOL b) { setParcelFlag(PF_SELL_PARCEL_OBJECTS, b); }
......
......@@ -86,7 +86,7 @@ public:
void setAutoScale(bool auto_scale);
void setZoomFactor(F64 zoom_factor) { mZoomFactor = zoom_factor; }
void setBackgroundColor(LLColor4 color) { mBackgroundColor = color; };
void setBackgroundColor(const LLColor4& color) { mBackgroundColor = color; };
void setOwner(LLPluginClassMediaOwner *owner) { mOwner = owner; };
......@@ -148,7 +148,7 @@ public:
// "Exited" means any regular or error state after "Running" (plugin may have crashed or exited normally)
bool isPluginExited(void) { return mPlugin?mPlugin->isDone():false; };
std::string getPluginVersion() { return mPlugin?mPlugin->getPluginVersion():std::string(""); };
std::string getPluginVersion() { return mPlugin?mPlugin->getPluginVersion():std::string(); };
bool getDisableTimeout() { return mPlugin?mPlugin->getDisableTimeout():false; };
void setDisableTimeout(bool disable) { if(mPlugin) mPlugin->setDisableTimeout(disable); };
......
......@@ -59,11 +59,10 @@ private:
struct LoadedFont
{
LoadedFont(std::string aName, std::unique_ptr<U8[]> aAddress, long aSize)
: mAddress(std::move(aAddress))
{
mName = aName;
mSize = aSize;
}
: mName(std::move(aName))
, mAddress(std::move(aAddress))
, mSize(aSize)
{ }
std::string mName;
std::unique_ptr<U8[]> mAddress;
......
......@@ -75,7 +75,7 @@ public:
std::string getImageName() const;
void setColor(const LLColor4& color) override { mColor = color; }
void setImage(LLPointer<LLUIImage> image) { mImagep = image; }
void setImage(LLPointer<LLUIImage> image) { mImagep = std::move(image); }
const LLPointer<LLUIImage> getImage() const { return mImagep; }
protected:
......
......@@ -130,7 +130,7 @@ public:
/*virtual*/ bool canEdit() const override { return true; }
/*virtual*/ const LLColor4& getColor() const override { return mStyle->getColor(); }
/*virtual*/ LLStyleConstSP getStyle() const override { return mStyle; }
/*virtual*/ void setStyle(LLStyleConstSP style) override { mStyle = style; }
/*virtual*/ void setStyle(LLStyleConstSP style) override { mStyle = std::move(style); }
/*virtual*/ void setToken( LLKeywordToken* token ) override { mToken = token; }
/*virtual*/ LLKeywordToken* getToken() const override { return mToken; }
/*virtual*/ BOOL getToolTip( std::string& msg ) const;
......
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