瀏覽代碼

fix variable type in for-in loops

Andrey Filipenkov 3 年之前
父節點
當前提交
aae1d4fed5
共有 2 個文件被更改,包括 2 次插入2 次删除
  1. 1 1
      AI/Nullkiller/Engine/PriorityEvaluator.cpp
  2. 1 1
      AI/VCAI/ResourceManager.cpp

+ 1 - 1
AI/Nullkiller/Engine/PriorityEvaluator.cpp

@@ -122,7 +122,7 @@ uint64_t getCreatureBankArmyReward(const CGObjectInstance * target, const CGHero
 	{
 		//No free slot, we might discard our weakest stack
 		weakestStackPower = std::numeric_limits<ui64>().max();
-		for (const auto stack : slots)
+		for (const auto & stack : slots)
 		{
 			vstd::amin(weakestStackPower, stack.second->getPower());
 		}

+ 1 - 1
AI/VCAI/ResourceManager.cpp

@@ -121,7 +121,7 @@ Goals::TSubgoal ResourceManager::collectResourcesForOurGoal(ResourceObjective &o
 	}
 
 	float goalPriority = 10; //arbitrary, will be divided
-	for (const resPair & p : missingResources)
+	for (const resPair p : missingResources)
 	{
 		if (!income[p.first]) //prioritize resources with 0 income
 		{