1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +02:00

Fix several new issues detected by SonarCloud

This commit is contained in:
Ivan Savenko
2024-11-20 16:06:38 +00:00
parent 80632cdf8b
commit aef6b0cc00
6 changed files with 15 additions and 12 deletions

View File

@@ -55,7 +55,7 @@ std::shared_ptr<CDefFile> RenderHandler::getAnimationFile(const AnimationPath &
return result;
}
std::optional<ResourcePath> RenderHandler::getPathForScaleFactor(ResourcePath path, std::string factor)
std::optional<ResourcePath> RenderHandler::getPathForScaleFactor(const ResourcePath & path, const std::string & factor)
{
if(path.getType() == EResType::IMAGE)
{
@@ -80,7 +80,7 @@ std::optional<ResourcePath> RenderHandler::getPathForScaleFactor(ResourcePath pa
return std::nullopt;
}
std::pair<ResourcePath, int> RenderHandler::getScalePath(ResourcePath p)
std::pair<ResourcePath, int> RenderHandler::getScalePath(const ResourcePath & p)
{
auto path = p;
int scaleFactor = 1;