aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/units
diff options
context:
space:
mode:
author Hop311 <hop3114@gmail.com>2023-09-28 22:03:14 +0200
committer Hop311 <hop3114@gmail.com>2023-09-28 22:03:14 +0200
commit84b5ee7a7749e2dbfeb214b4cedd16d5522f4197 (patch)
treecd810aceed54196aa62aa766f79039cd57a1e600 /src/openvic-simulation/units
parent5764126f4a3940320990a9bc3007ba22e89a514c (diff)
Removed unnecessary `const std::string_view`s
Diffstat (limited to 'src/openvic-simulation/units')
-rw-r--r--src/openvic-simulation/units/Unit.cpp6
-rw-r--r--src/openvic-simulation/units/Unit.hpp6
2 files changed, 6 insertions, 6 deletions
diff --git a/src/openvic-simulation/units/Unit.cpp b/src/openvic-simulation/units/Unit.cpp
index b965f93..16719e6 100644
--- a/src/openvic-simulation/units/Unit.cpp
+++ b/src/openvic-simulation/units/Unit.cpp
@@ -172,7 +172,7 @@ fixed_point_t NavalUnit::get_torpedo_attack() const {
UnitManager::UnitManager() : units { "units" } {}
-bool UnitManager::_check_shared_parameters(const std::string_view identifier, UNIT_PARAMS) {
+bool UnitManager::_check_shared_parameters(std::string_view identifier, UNIT_PARAMS) {
if (identifier.empty()) {
Logger::error("Invalid religion identifier - empty!");
return false;
@@ -193,7 +193,7 @@ bool UnitManager::_check_shared_parameters(const std::string_view identifier, UN
return true;
}
-bool UnitManager::add_land_unit(const std::string_view identifier, UNIT_PARAMS, LAND_PARAMS) {
+bool UnitManager::add_land_unit(std::string_view identifier, UNIT_PARAMS, LAND_PARAMS) {
if (!_check_shared_parameters(identifier, UNIT_ARGS)) {
return false;
}
@@ -201,7 +201,7 @@ bool UnitManager::add_land_unit(const std::string_view identifier, UNIT_PARAMS,
return units.add_item(LandUnit { identifier, UNIT_ARGS, LAND_ARGS });
}
-bool UnitManager::add_naval_unit(const std::string_view identifier, UNIT_PARAMS, NAVY_PARAMS) {
+bool UnitManager::add_naval_unit(std::string_view identifier, UNIT_PARAMS, NAVY_PARAMS) {
if (!_check_shared_parameters(identifier, UNIT_ARGS)) {
return false;
}
diff --git a/src/openvic-simulation/units/Unit.hpp b/src/openvic-simulation/units/Unit.hpp
index dc7c00f..979ae70 100644
--- a/src/openvic-simulation/units/Unit.hpp
+++ b/src/openvic-simulation/units/Unit.hpp
@@ -147,13 +147,13 @@ namespace OpenVic {
private:
IdentifierRegistry<Unit> units;
- bool _check_shared_parameters(const std::string_view identifier, UNIT_PARAMS);
+ bool _check_shared_parameters(std::string_view identifier, UNIT_PARAMS);
public:
UnitManager();
- bool add_land_unit(const std::string_view identifier, UNIT_PARAMS, LAND_PARAMS);
- bool add_naval_unit(const std::string_view identifier, UNIT_PARAMS, NAVY_PARAMS);
+ bool add_land_unit(std::string_view identifier, UNIT_PARAMS, LAND_PARAMS);
+ bool add_naval_unit(std::string_view identifier, UNIT_PARAMS, NAVY_PARAMS);
IDENTIFIER_REGISTRY_ACCESSORS(Unit, unit)
bool load_unit_file(GoodManager const& good_manager, ast::NodeCPtr root);