1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-06 09:09:40 +02:00

Fixes for multiple new issues from Sonar

This commit is contained in:
Ivan Savenko
2025-02-20 16:57:52 +00:00
parent 0548f325e4
commit 2362c6da21
50 changed files with 190 additions and 223 deletions

View File

@@ -329,7 +329,7 @@ public:
{
return getDwellings().at(upgradeIndex).at(level);
}
catch (const std::out_of_range & e)
catch (const std::out_of_range &)
{
return Type::NONE;
}
@@ -337,7 +337,7 @@ public:
static int getLevelFromDwelling(BuildingIDBase dwelling)
{
for (const auto level : getDwellings())
for (const auto & level : getDwellings())
{
auto it = std::find(level.begin(), level.end(), dwelling);
if (it != level.end())
@@ -368,9 +368,9 @@ public:
dwelling.setNum(getDwellingFromLevel(level, upgrade + 1));
}
bool IsDwelling() const
bool isDwelling() const
{
for (const auto level : getDwellings())
for (const auto & level : getDwellings())
{
if (vstd::contains(level, num))
return true;