Merge pull request #7283 from IvanSavenko/sonar

[1.8] Fix new Sonar warnings
This commit is contained in:
Ivan Savenko
2026-04-30 17:42:14 +03:00
committed by GitHub
31 changed files with 74 additions and 84 deletions
-4
View File
@@ -800,10 +800,6 @@ void AIGateway::makeTurn()
{
logAi->debug("Making turn thread has been terminated. We'll end without calling endTurn");
}
catch (...)
{
logAi->error("Unknown exception in makeTurn. Ending turn without calling endTurn.");
}
}
void AIGateway::performObjectInteraction(const CGObjectInstance * obj, HeroPtr heroPtr)
+2 -2
View File
@@ -248,13 +248,13 @@ public:
void add(std::unique_ptr<T> t)
{
std::lock_guard<std::mutex> lock(sync);
std::lock_guard lock(sync);
pool.push_back(std::move(t));
}
ptr_type acquire()
{
std::lock_guard<std::mutex> lock(sync);
std::lock_guard lock(sync);
bool poolIsEmpty = pool.empty();
T * element = poolIsEmpty
? elementFactory().release()
+1 -1
View File
@@ -21,7 +21,7 @@
#include "../Goals/ExecuteHeroChain.h"
#include "../Goals/RecruitHero.h"
#include "../Markers/DefendTown.h"
#include "../../lib/IGameSettings.h"
#include "../../../lib/IGameSettings.h"
namespace NK2AI
{
+1 -1
View File
@@ -385,7 +385,7 @@ HeroLockedReason Nullkiller::getHeroLockedReason(const CGHeroInstance * hero) co
void Nullkiller::makeTurn()
{
std::lock_guard<std::mutex> sharedStorageLock(AISharedStorage::locker);
std::lock_guard sharedStorageLock(AISharedStorage::locker);
pathfinderTurnStorageMisses.store(0);
const int MAX_DEPTH = 10;
resetState();