From f79c4fba049c15d13892617e11b1e63d2c4dc2cc Mon Sep 17 00:00:00 2001 From: Deukhoofd Date: Tue, 31 Dec 2019 12:35:48 +0100 Subject: [PATCH] Removes another unused dependency, performance improvements for MoveData --- src/Library/Moves/MoveData.cpp | 10 +++++----- src/Library/Moves/MoveData.hpp | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Library/Moves/MoveData.cpp b/src/Library/Moves/MoveData.cpp index dad7dbc..740ecbb 100644 --- a/src/Library/Moves/MoveData.cpp +++ b/src/Library/Moves/MoveData.cpp @@ -1,11 +1,11 @@ #include "MoveData.hpp" -#include -PkmnLib::Library::MoveData::MoveData(std::string name, std::string type, PkmnLib::Library::MoveCategory category, - uint8_t power, uint8_t accuracy, uint8_t baseUsage, - CreatureLib::Library::AttackTarget target, uint8_t priority, +#include +PkmnLib::Library::MoveData::MoveData(const std::string& name, const std::string& type, + PkmnLib::Library::MoveCategory category, uint8_t power, uint8_t accuracy, + uint8_t baseUsage, CreatureLib::Library::AttackTarget target, uint8_t priority, std::unordered_set flags) : AttackData(name, type, static_cast(category), power, accuracy, baseUsage, - target, priority, flags) {} + target, priority, std::move(flags)) {} PkmnLib::Library::MoveCategory PkmnLib::Library::MoveData::GetCategory() const { return static_cast(AttackData::GetCategory()); diff --git a/src/Library/Moves/MoveData.hpp b/src/Library/Moves/MoveData.hpp index f1032e0..9852194 100644 --- a/src/Library/Moves/MoveData.hpp +++ b/src/Library/Moves/MoveData.hpp @@ -9,7 +9,7 @@ namespace PkmnLib::Library { private: public: - MoveData(std::string name, std::string type, PkmnLib::Library::MoveCategory category, uint8_t power, + MoveData(const std::string& name, const std::string& type, PkmnLib::Library::MoveCategory category, uint8_t power, uint8_t accuracy, uint8_t baseUsage, CreatureLib::Library::AttackTarget target, uint8_t priority, std::unordered_set flags);