Issue found with PVS-Studio:

A lot of instances where some function args are not actually modified in any way, meaning that it is better for performance to convert them into const references. This prevents an additional copy, which can help performance.
This commit is contained in:
Areloch 2015-07-16 22:02:18 -05:00
parent ec63398042
commit 11398bb04e
40 changed files with 59 additions and 59 deletions

View file

@ -918,7 +918,7 @@ void DICreateUndoAction::initPersistFields()
Parent::initPersistFields();
}
void DICreateUndoAction::addDecal( DecalInstance decal )
void DICreateUndoAction::addDecal(const DecalInstance& decal)
{
mDecalInstance = decal;
mDatablockId = decal.mDataBlock->getId();
@ -1006,7 +1006,7 @@ void DIDeleteUndoAction::initPersistFields()
Parent::initPersistFields();
}
void DIDeleteUndoAction::deleteDecal( DecalInstance decal )
void DIDeleteUndoAction::deleteDecal(const DecalInstance& decal)
{
mDecalInstance = decal;
mDatablockId = decal.mDataBlock->getId();
@ -1094,7 +1094,7 @@ void DBDeleteUndoAction::initPersistFields()
Parent::initPersistFields();
}
void DBDeleteUndoAction::deleteDecal( DecalInstance decal )
void DBDeleteUndoAction::deleteDecal(const DecalInstance& decal)
{
mDecalInstanceVec.increment();
mDecalInstanceVec.last() = decal;

View file

@ -129,7 +129,7 @@ public:
DICreateUndoAction( const UTF8* actionName = "Create Decal " );
virtual ~DICreateUndoAction();
void addDecal( DecalInstance decal );
void addDecal(const DecalInstance& decal);
// UndoAction
virtual void undo();
@ -159,7 +159,7 @@ public:
virtual ~DIDeleteUndoAction();
///
void deleteDecal( DecalInstance decal );
void deleteDecal(const DecalInstance& decal);
// UndoAction
virtual void undo();
@ -188,7 +188,7 @@ public:
DBDeleteUndoAction( const UTF8* actionName = "Delete Decal Datablock" );
virtual ~DBDeleteUndoAction();
void deleteDecal( DecalInstance decal );
void deleteDecal(const DecalInstance& decal);
// UndoAction
virtual void undo();