Skip to content
Snippets Groups Projects
Commit d328598c authored by Rye Mutt's avatar Rye Mutt :bread:
Browse files

Change many empty constructor and destructor to default for better compiler optimization

parent f9c5815d
No related branches found
No related tags found
No related merge requests found
Showing
with 25 additions and 85 deletions
...@@ -60,11 +60,10 @@ class LLAvatarAppearance : public LLCharacter ...@@ -60,11 +60,10 @@ class LLAvatarAppearance : public LLCharacter
** ** ** **
** INITIALIZATION ** INITIALIZATION
**/ **/
private:
// Hide default constructor.
LLAvatarAppearance() {}
public: public:
// Delete the default constructor. Force construction with wearable data
LLAvatarAppearance() = delete;
LLAvatarAppearance(LLWearableData* wearable_data); LLAvatarAppearance(LLWearableData* wearable_data);
virtual ~LLAvatarAppearance(); virtual ~LLAvatarAppearance();
......
...@@ -80,10 +80,10 @@ class LLDriverParamInfo final : public LLViewerVisualParamInfo ...@@ -80,10 +80,10 @@ class LLDriverParamInfo final : public LLViewerVisualParamInfo
LL_ALIGN_PREFIX(16) LL_ALIGN_PREFIX(16)
class LLDriverParam final : public LLViewerVisualParam class LLDriverParam final : public LLViewerVisualParam
{ {
private:
// Hide the default constructor. Force construction with LLAvatarAppearance.
LLDriverParam() {}
public: public:
// Delete the default constructor. Force construction with LLAvatarAppearance.
LLDriverParam() = delete;
LLDriverParam(LLAvatarAppearance *appearance, LLWearable* wearable = NULL); LLDriverParam(LLAvatarAppearance *appearance, LLWearable* wearable = NULL);
~LLDriverParam() = default; ~LLDriverParam() = default;
......
...@@ -41,10 +41,6 @@ ...@@ -41,10 +41,6 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// LLPolySkeletalDistortionInfo() // LLPolySkeletalDistortionInfo()
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
LLPolySkeletalDistortionInfo::LLPolySkeletalDistortionInfo()
{
}
BOOL LLPolySkeletalDistortionInfo::parseXml(LLXmlTreeNode* node) BOOL LLPolySkeletalDistortionInfo::parseXml(LLXmlTreeNode* node)
{ {
llassert( node->hasName( "param" ) && node->getChildByName( "param_skeleton" ) ); llassert( node->hasName( "param" ) && node->getChildByName( "param_skeleton" ) );
...@@ -117,15 +113,6 @@ LLPolySkeletalDistortion::LLPolySkeletalDistortion(LLAvatarAppearance *avatarp) ...@@ -117,15 +113,6 @@ LLPolySkeletalDistortion::LLPolySkeletalDistortion(LLAvatarAppearance *avatarp)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// LLPolySkeletalDistortion() // LLPolySkeletalDistortion()
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
LLPolySkeletalDistortion::LLPolySkeletalDistortion(const LLPolySkeletalDistortion &pOther)
: LLViewerVisualParam(pOther),
mDefaultVec(pOther.mDefaultVec),
mJointScales(pOther.mJointScales),
mJointOffsets(pOther.mJointOffsets),
mAvatar(pOther.mAvatar)
{
}
BOOL LLPolySkeletalDistortion::setInfo(LLPolySkeletalDistortionInfo *info) BOOL LLPolySkeletalDistortion::setInfo(LLPolySkeletalDistortionInfo *info)
{ {
if (info->mID < 0) if (info->mID < 0)
......
...@@ -68,7 +68,7 @@ class LLPolySkeletalDistortionInfo : public LLViewerVisualParamInfo ...@@ -68,7 +68,7 @@ class LLPolySkeletalDistortionInfo : public LLViewerVisualParamInfo
friend class LLPolySkeletalDistortion; friend class LLPolySkeletalDistortion;
public: public:
LLPolySkeletalDistortionInfo(); LLPolySkeletalDistortionInfo() = default;
/*virtual*/ ~LLPolySkeletalDistortionInfo() = default; /*virtual*/ ~LLPolySkeletalDistortionInfo() = default;
/*virtual*/ BOOL parseXml(LLXmlTreeNode* node); /*virtual*/ BOOL parseXml(LLXmlTreeNode* node);
...@@ -131,7 +131,7 @@ class LLPolySkeletalDistortion : public LLViewerVisualParam ...@@ -131,7 +131,7 @@ class LLPolySkeletalDistortion : public LLViewerVisualParam
/*virtual*/ const LLVector4a* getNextDistortion(U32 *index, LLPolyMesh **poly_mesh){index = 0; poly_mesh = NULL; return NULL;}; /*virtual*/ const LLVector4a* getNextDistortion(U32 *index, LLPolyMesh **poly_mesh){index = 0; poly_mesh = NULL; return NULL;};
protected: protected:
LLPolySkeletalDistortion(const LLPolySkeletalDistortion& pOther); LLPolySkeletalDistortion(const LLPolySkeletalDistortion& pOther) = default;
LL_ALIGN_16(LLVector4a mDefaultVec); LL_ALIGN_16(LLVector4a mDefaultVec);
typedef std::map<LLJoint*, LLVector3> joint_vec_map_t; typedef std::map<LLJoint*, LLVector3> joint_vec_map_t;
......
...@@ -93,12 +93,6 @@ LLTexParamGlobalColor::LLTexParamGlobalColor(LLTexGlobalColor* tex_global_color) ...@@ -93,12 +93,6 @@ LLTexParamGlobalColor::LLTexParamGlobalColor(LLTexGlobalColor* tex_global_color)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// LLTexParamGlobalColor // LLTexParamGlobalColor
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
LLTexParamGlobalColor::LLTexParamGlobalColor(const LLTexParamGlobalColor& pOther)
: LLTexLayerParamColor(pOther),
mTexGlobalColor(pOther.mTexGlobalColor)
{
}
/*virtual*/ LLViewerVisualParam* LLTexParamGlobalColor::cloneParam(LLWearable* wearable) const /*virtual*/ LLViewerVisualParam* LLTexParamGlobalColor::cloneParam(LLWearable* wearable) const
{ {
return new LLTexParamGlobalColor(*this); return new LLTexParamGlobalColor(*this);
...@@ -113,11 +107,6 @@ void LLTexParamGlobalColor::onGlobalColorChanged() ...@@ -113,11 +107,6 @@ void LLTexParamGlobalColor::onGlobalColorChanged()
// LLTexGlobalColorInfo // LLTexGlobalColorInfo
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
LLTexGlobalColorInfo::LLTexGlobalColorInfo()
{
}
LLTexGlobalColorInfo::~LLTexGlobalColorInfo() LLTexGlobalColorInfo::~LLTexGlobalColorInfo()
{ {
for_each(mParamColorInfoList.begin(), mParamColorInfoList.end(), DeletePointer()); for_each(mParamColorInfoList.begin(), mParamColorInfoList.end(), DeletePointer());
......
...@@ -61,7 +61,7 @@ class LLTexGlobalColorInfo ...@@ -61,7 +61,7 @@ class LLTexGlobalColorInfo
{ {
friend class LLTexGlobalColor; friend class LLTexGlobalColor;
public: public:
LLTexGlobalColorInfo(); LLTexGlobalColorInfo() = default;
~LLTexGlobalColorInfo(); ~LLTexGlobalColorInfo();
BOOL parseXml(LLXmlTreeNode* node); BOOL parseXml(LLXmlTreeNode* node);
...@@ -78,7 +78,7 @@ class LLTexParamGlobalColor : public LLTexLayerParamColor ...@@ -78,7 +78,7 @@ class LLTexParamGlobalColor : public LLTexLayerParamColor
virtual ~LLTexParamGlobalColor() = default; virtual ~LLTexParamGlobalColor() = default;
/*virtual*/ LLViewerVisualParam* cloneParam(LLWearable* wearable) const; /*virtual*/ LLViewerVisualParam* cloneParam(LLWearable* wearable) const;
protected: protected:
LLTexParamGlobalColor(const LLTexParamGlobalColor& pOther); LLTexParamGlobalColor(const LLTexParamGlobalColor& pOther) = default;
/*virtual*/ void onGlobalColorChanged(); /*virtual*/ void onGlobalColorChanged();
private: private:
LLTexGlobalColor* mTexGlobalColor; LLTexGlobalColor* mTexGlobalColor;
......
...@@ -62,13 +62,6 @@ LLTexLayerParam::LLTexLayerParam(LLAvatarAppearance *appearance) ...@@ -62,13 +62,6 @@ LLTexLayerParam::LLTexLayerParam(LLAvatarAppearance *appearance)
{ {
} }
LLTexLayerParam::LLTexLayerParam(const LLTexLayerParam& pOther)
: LLViewerVisualParam(pOther),
mTexLayer(pOther.mTexLayer),
mAvatarAppearance(pOther.mAvatarAppearance)
{
}
BOOL LLTexLayerParam::setInfo(LLViewerVisualParamInfo *info, BOOL add_to_appearance) BOOL LLTexLayerParam::setInfo(LLViewerVisualParamInfo *info, BOOL add_to_appearance)
{ {
LLViewerVisualParam::setInfo(info); LLViewerVisualParam::setInfo(info);
...@@ -433,12 +426,6 @@ LLTexLayerParamColor::LLTexLayerParamColor(LLAvatarAppearance *appearance) ...@@ -433,12 +426,6 @@ LLTexLayerParamColor::LLTexLayerParamColor(LLAvatarAppearance *appearance)
{ {
} }
LLTexLayerParamColor::LLTexLayerParamColor(const LLTexLayerParamColor& pOther)
: LLTexLayerParam(pOther),
mAvgDistortionVec(pOther.mAvgDistortionVec)
{
}
/*virtual*/ LLViewerVisualParam* LLTexLayerParamColor::cloneParam(LLWearable* wearable) const /*virtual*/ LLViewerVisualParam* LLTexLayerParamColor::cloneParam(LLWearable* wearable) const
{ {
return new LLTexLayerParamColor(*this); return new LLTexLayerParamColor(*this);
......
...@@ -52,7 +52,7 @@ class LLTexLayerParam : public LLViewerVisualParam ...@@ -52,7 +52,7 @@ class LLTexLayerParam : public LLViewerVisualParam
/*virtual*/ LLViewerVisualParam* cloneParam(LLWearable* wearable) const = 0; /*virtual*/ LLViewerVisualParam* cloneParam(LLWearable* wearable) const = 0;
protected: protected:
LLTexLayerParam(const LLTexLayerParam& pOther); LLTexLayerParam(const LLTexLayerParam& pOther) = default;
LLTexLayerInterface* mTexLayer; LLTexLayerInterface* mTexLayer;
LLAvatarAppearance* mAvatarAppearance; LLAvatarAppearance* mAvatarAppearance;
...@@ -194,7 +194,7 @@ class LLTexLayerParamColor : public LLTexLayerParam ...@@ -194,7 +194,7 @@ class LLTexLayerParamColor : public LLTexLayerParam
// New functions // New functions
LLColor4 getNetColor() const; LLColor4 getNetColor() const;
protected: protected:
LLTexLayerParamColor(const LLTexLayerParamColor& pOther); LLTexLayerParamColor(const LLTexLayerParamColor& pOther) = default;
virtual void onGlobalColorChanged() {} virtual void onGlobalColorChanged() {}
private: private:
......
...@@ -123,14 +123,6 @@ LLViewerVisualParam::LLViewerVisualParam() ...@@ -123,14 +123,6 @@ LLViewerVisualParam::LLViewerVisualParam()
{ {
} }
//-----------------------------------------------------------------------------
// LLViewerVisualParam()
//-----------------------------------------------------------------------------
LLViewerVisualParam::LLViewerVisualParam(const LLViewerVisualParam& pOther)
: LLVisualParam(pOther)
{
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// setInfo() // setInfo()
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
......
...@@ -106,7 +106,7 @@ class LLViewerVisualParam : public LLVisualParam ...@@ -106,7 +106,7 @@ class LLViewerVisualParam : public LLVisualParam
BOOL getCrossWearable() const { return getInfo()->mCrossWearable; } BOOL getCrossWearable() const { return getInfo()->mCrossWearable; }
protected: protected:
LLViewerVisualParam(const LLViewerVisualParam& pOther); LLViewerVisualParam(const LLViewerVisualParam& pOther) = default;
} LL_ALIGN_POSTFIX(16); } LL_ALIGN_POSTFIX(16);
#endif // LL_LLViewerVisualParam_H #endif // LL_LLViewerVisualParam_H
...@@ -66,10 +66,6 @@ LLWearableType::LLWearableType(LLTranslationBridge::ptr_t &trans) ...@@ -66,10 +66,6 @@ LLWearableType::LLWearableType(LLTranslationBridge::ptr_t &trans)
{ {
} }
LLWearableType::~LLWearableType()
{
}
void LLWearableType::initSingleton() void LLWearableType::initSingleton()
{ {
} }
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
class LLWearableType final : public LLParamSingleton<LLWearableType> class LLWearableType final : public LLParamSingleton<LLWearableType>
{ {
LLSINGLETON(LLWearableType, LLTranslationBridge::ptr_t &trans); LLSINGLETON(LLWearableType, LLTranslationBridge::ptr_t &trans);
~LLWearableType(); ~LLWearableType() = default;
void initSingleton() override; void initSingleton() override;
public: public:
enum EType enum EType
...@@ -109,7 +109,7 @@ class LLWearableType final : public LLParamSingleton<LLWearableType> ...@@ -109,7 +109,7 @@ class LLWearableType final : public LLParamSingleton<LLWearableType>
{ {
public: public:
LLWearableDictionary(LLTranslationBridge::ptr_t& trans); LLWearableDictionary(LLTranslationBridge::ptr_t& trans);
~LLWearableDictionary() {} ~LLWearableDictionary() = default;
}; };
LLWearableDictionary mDictionary; LLWearableDictionary mDictionary;
......
...@@ -68,7 +68,7 @@ class LLVorbisDecodeState final : public LLRefCount ...@@ -68,7 +68,7 @@ class LLVorbisDecodeState final : public LLRefCount
{ {
public: public:
WriteResponder(LLVorbisDecodeState* decoder) : mDecoder(decoder) {} WriteResponder(LLVorbisDecodeState* decoder) : mDecoder(decoder) {}
~WriteResponder() {} ~WriteResponder() = default;
void completed(S32 bytes) void completed(S32 bytes)
{ {
mDecoder->ioComplete(bytes); mDecoder->ioComplete(bytes);
...@@ -542,8 +542,8 @@ class LLAudioDecodeMgr::Impl ...@@ -542,8 +542,8 @@ class LLAudioDecodeMgr::Impl
{ {
friend class LLAudioDecodeMgr; friend class LLAudioDecodeMgr;
public: public:
Impl() {}; Impl() = default;
~Impl() {}; ~Impl() = default;
void processQueue(const F32 num_secs = 0.005); void processQueue(const F32 num_secs = 0.005);
......
...@@ -55,9 +55,7 @@ class LLAllocatorHeapProfile ...@@ -55,9 +55,7 @@ class LLAllocatorHeapProfile
typedef std::vector<line> lines_t; typedef std::vector<line> lines_t;
LLAllocatorHeapProfile() LLAllocatorHeapProfile() = default;
{
}
void parse(std::string const & prof_text); void parse(std::string const & prof_text);
......
...@@ -115,10 +115,6 @@ std::ostream& operator<<(std::ostream& s, const LLCallStack& call_stack) ...@@ -115,10 +115,6 @@ std::ostream& operator<<(std::ostream& s, const LLCallStack& call_stack)
return s; return s;
} }
LLContextStrings::LLContextStrings()
{
}
// static // static
LLContextStrings* LLContextStrings::getThreadLocalInstance() LLContextStrings* LLContextStrings::getThreadLocalInstance()
{ {
......
...@@ -46,7 +46,7 @@ LL_COMMON_API std::ostream& operator<<(std::ostream& s, const LLCallStack& call_ ...@@ -46,7 +46,7 @@ LL_COMMON_API std::ostream& operator<<(std::ostream& s, const LLCallStack& call_
class LLContextStrings class LLContextStrings
{ {
public: public:
LLContextStrings(); LLContextStrings() = default;
static void addContextString(const std::string& str); static void addContextString(const std::string& str);
static void removeContextString(const std::string& str); static void removeContextString(const std::string& str);
static void output(std::ostream& os); static void output(std::ostream& os);
......
...@@ -133,10 +133,6 @@ LLCoros::LLCoros(): ...@@ -133,10 +133,6 @@ LLCoros::LLCoros():
{ {
} }
LLCoros::~LLCoros()
{
}
void LLCoros::cleanupSingleton() void LLCoros::cleanupSingleton()
{ {
// Some of the coroutines (like voice) will depend onto // Some of the coroutines (like voice) will depend onto
......
...@@ -88,9 +88,9 @@ namespace boost { ...@@ -88,9 +88,9 @@ namespace boost {
class LL_COMMON_API LLCoros final : public LLSingleton<LLCoros> class LL_COMMON_API LLCoros final : public LLSingleton<LLCoros>
{ {
LLSINGLETON(LLCoros); LLSINGLETON(LLCoros);
~LLCoros(); ~LLCoros() = default;
void cleanupSingleton(); void cleanupSingleton() override;
public: public:
/// The viewer's use of the term "coroutine" became deeply embedded before /// The viewer's use of the term "coroutine" became deeply embedded before
/// the industry term "fiber" emerged to distinguish userland threads from /// the industry term "fiber" emerged to distinguish userland threads from
......
...@@ -171,7 +171,7 @@ std::ostream& LLDependencies_describe(std::ostream& out, const std::string& key) ...@@ -171,7 +171,7 @@ std::ostream& LLDependencies_describe(std::ostream& out, const std::string& key)
*/ */
struct LLDependenciesEmpty struct LLDependenciesEmpty
{ {
LLDependenciesEmpty() {} LLDependenciesEmpty() = default;
/** /**
* Give it a constructor accepting void* so caller can pass placeholder * Give it a constructor accepting void* so caller can pass placeholder
* values such as NULL or 0 rather than having to write * values such as NULL or 0 rather than having to write
...@@ -220,7 +220,7 @@ class LLDependencies: public LLDependenciesBase ...@@ -220,7 +220,7 @@ class LLDependencies: public LLDependenciesBase
typedef boost::function<const typename DepNode::dep_set&(const DepNode&)> dep_selector; typedef boost::function<const typename DepNode::dep_set&(const DepNode&)> dep_selector;
public: public:
LLDependencies() {} LLDependencies() = default;
typedef KEY key_type; typedef KEY key_type;
typedef NODE node_type; typedef NODE node_type;
......
...@@ -119,7 +119,7 @@ class LLDoubleDispatch ...@@ -119,7 +119,7 @@ class LLDoubleDispatch
typedef LLDoubleDispatch<ReturnType, ParamBaseType> self_type; typedef LLDoubleDispatch<ReturnType, ParamBaseType> self_type;
public: public:
LLDoubleDispatch() {} LLDoubleDispatch() = default;
/** /**
* Call the first matching entry. If there's no registered Functor * Call the first matching entry. If there's no registered Functor
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment