Browse Source

Use reference

Tomasz Zieliński 2 years ago
parent
commit
69ff1734b0
1 changed files with 2 additions and 2 deletions
  1. 2 2
      lib/rmg/RmgObject.cpp

+ 2 - 2
lib/rmg/RmgObject.cpp

@@ -275,7 +275,7 @@ const rmg::Area & Object::getBlockVisitableArea() const
 	if(dInstances.empty())
 		return dBlockVisitableCache;
 
-	for(const auto i : dInstances)
+	for(const auto & i : dInstances)
 	{
 		// FIXME: Account for blockvis objects with multiple visitable tiles
 		if (i.isBlockedVisitable())
@@ -290,7 +290,7 @@ const rmg::Area & Object::getRemovableArea() const
 	if(dInstances.empty())
 		return dRemovableAreaCache;
 
-	for(const auto i : dInstances)
+	for(const auto & i : dInstances)
 	{
 		if (i.isRemovable())
 			dRemovableAreaCache.unite(i.getBlockedArea());