Fixed clang-tidy warnings

This commit is contained in:
Jan Mrna
2025-10-31 07:22:26 +01:00
parent 69d08e5310
commit 30eecc366e
6 changed files with 11 additions and 9 deletions

View File

@@ -22,7 +22,7 @@ enum class PathFinderType {
class PathFinderBase {
public:
PathFinderBase(const Map *m);
~PathFinderBase() = default;
virtual ~PathFinderBase() = default;
PathFinderBase(const PathFinderBase &) = delete;
PathFinderBase(PathFinderBase &&) = delete;
@@ -36,7 +36,7 @@ protected:
const Map *m_Map;
};
class LinearPathFinder : public PathFinderBase {
class LinearPathFinder final : public PathFinderBase {
public:
LinearPathFinder(const Map *m) : PathFinderBase(m) {}

View File

@@ -9,7 +9,7 @@
namespace pathfinder {
class BFS : public PathFinderBase {
class BFS final : public PathFinderBase {
public:
BFS(const Map *m) : PathFinderBase(m) {}

View File

@@ -10,7 +10,7 @@
namespace pathfinder {
class Dijkstra : public PathFinderBase {
class Dijkstra final : public PathFinderBase {
public:
Dijkstra(const Map *m) : PathFinderBase(m) {}

View File

@@ -10,7 +10,7 @@
namespace pathfinder {
class GBFS : public PathFinderBase {
class GBFS final : public PathFinderBase {
public:
GBFS(const Map *m) : PathFinderBase(m) {}

View File

@@ -17,13 +17,13 @@ std::unique_ptr<PathFinderBase> create(PathFinderType type, const Map *map) {
using namespace pathfinder;
switch (type) {
case PathFinderType::LINEAR:
return std::move(std::make_unique<LinearPathFinder>(map));
return std::make_unique<LinearPathFinder>(map);
case PathFinderType::BFS:
return std::move(std::make_unique<BFS>(map));
return std::make_unique<BFS>(map);
case PathFinderType::DIJKSTRA:
return std::move(std::make_unique<Dijkstra>(map));
return std::make_unique<Dijkstra>(map);
case PathFinderType::GBFS:
return std::move(std::make_unique<GBFS>(map));
return std::make_unique<GBFS>(map);
case PathFinderType::COUNT:
LOG_WARNING("Incorrect pathfinder type");
return nullptr;