mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-04-16 08:42:23 +00:00
Dont copy-construct from a const-ref when used only as a const-ref
This also makes clang-tiny a bit happier
This commit is contained in:
parent
4f99c060c3
commit
deb2af6acc
@ -36,7 +36,7 @@ void CSVTools::SearchSubView::replace (bool selection)
|
|||||||
// in a single string.
|
// in a single string.
|
||||||
for (std::vector<int>::const_reverse_iterator iter (indices.rbegin()); iter!=indices.rend(); ++iter)
|
for (std::vector<int>::const_reverse_iterator iter (indices.rbegin()); iter!=indices.rend(); ++iter)
|
||||||
{
|
{
|
||||||
CSMWorld::UniversalId id = model.getUniversalId (*iter);
|
const CSMWorld::UniversalId& id = model.getUniversalId (*iter);
|
||||||
|
|
||||||
CSMWorld::UniversalId::Type type = CSMWorld::UniversalId::getParentType (id.getType());
|
CSMWorld::UniversalId::Type type = CSMWorld::UniversalId::getParentType (id.getType());
|
||||||
|
|
||||||
|
@ -704,7 +704,7 @@ namespace MWGui
|
|||||||
if (!MWBase::Environment::get().getWindowManager()->isAllowed(GW_Inventory))
|
if (!MWBase::Environment::get().getWindowManager()->isAllowed(GW_Inventory))
|
||||||
return;
|
return;
|
||||||
// make sure the object is of a type that can be picked up
|
// make sure the object is of a type that can be picked up
|
||||||
std::string type = object.getTypeName();
|
const std::string& type = object.getTypeName();
|
||||||
if ( (type != typeid(ESM::Apparatus).name())
|
if ( (type != typeid(ESM::Apparatus).name())
|
||||||
&& (type != typeid(ESM::Armor).name())
|
&& (type != typeid(ESM::Armor).name())
|
||||||
&& (type != typeid(ESM::Book).name())
|
&& (type != typeid(ESM::Book).name())
|
||||||
|
@ -143,7 +143,7 @@ MWWorld::ContainerStoreIterator MWWorld::InventoryStore::add(const Ptr& itemPtr,
|
|||||||
if (allowAutoEquip && actorPtr != MWMechanics::getPlayer()
|
if (allowAutoEquip && actorPtr != MWMechanics::getPlayer()
|
||||||
&& actorPtr.getClass().isNpc() && !actorPtr.getClass().getNpcStats(actorPtr).isWerewolf())
|
&& actorPtr.getClass().isNpc() && !actorPtr.getClass().getNpcStats(actorPtr).isWerewolf())
|
||||||
{
|
{
|
||||||
std::string type = itemPtr.getTypeName();
|
const std::string& type = itemPtr.getTypeName();
|
||||||
if (type == typeid(ESM::Armor).name() || type == typeid(ESM::Clothing).name())
|
if (type == typeid(ESM::Armor).name() || type == typeid(ESM::Clothing).name())
|
||||||
autoEquip(actorPtr);
|
autoEquip(actorPtr);
|
||||||
}
|
}
|
||||||
@ -748,7 +748,7 @@ int MWWorld::InventoryStore::remove(const Ptr& item, int count, const Ptr& actor
|
|||||||
if (equipReplacement && wasEquipped && (actor != MWMechanics::getPlayer())
|
if (equipReplacement && wasEquipped && (actor != MWMechanics::getPlayer())
|
||||||
&& actor.getClass().isNpc() && !actor.getClass().getNpcStats(actor).isWerewolf())
|
&& actor.getClass().isNpc() && !actor.getClass().getNpcStats(actor).isWerewolf())
|
||||||
{
|
{
|
||||||
std::string type = item.getTypeName();
|
const std::string& type = item.getTypeName();
|
||||||
if (type == typeid(ESM::Armor).name() || type == typeid(ESM::Clothing).name())
|
if (type == typeid(ESM::Armor).name() || type == typeid(ESM::Clothing).name())
|
||||||
autoEquip(actor);
|
autoEquip(actor);
|
||||||
}
|
}
|
||||||
|
@ -58,7 +58,7 @@ btCollisionShape* BulletShape::duplicateCollisionShape(const btCollisionShape *s
|
|||||||
for(int i = 0;i < numShapes;++i)
|
for(int i = 0;i < numShapes;++i)
|
||||||
{
|
{
|
||||||
btCollisionShape *child = duplicateCollisionShape(comp->getChildShape(i));
|
btCollisionShape *child = duplicateCollisionShape(comp->getChildShape(i));
|
||||||
btTransform trans = comp->getChildTransform(i);
|
const btTransform& trans = comp->getChildTransform(i);
|
||||||
newShape->addChildShape(trans, child);
|
newShape->addChildShape(trans, child);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user