diff options
author | Hop311 <Hop3114@gmail.com> | 2023-08-12 18:54:55 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-12 18:54:55 +0200 |
commit | d3c6ff1809b88b4c99163402f30b6d10c787510f (patch) | |
tree | e4bf26ecfef160e7df7670e73af7f154f1550308 /src/openvic/pop/Religion.hpp | |
parent | 538e7dc4ec44c4d09a6a654f10229e6392653a50 (diff) | |
parent | afc16e76ba699b24ba1ef1cb1b658ef421c84430 (diff) |
Merge pull request #11 from OpenVicProject/string_view
Changed IdentifierRegistry to use std::string_view when looking up a std::string key
Diffstat (limited to 'src/openvic/pop/Religion.hpp')
-rw-r--r-- | src/openvic/pop/Religion.hpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/openvic/pop/Religion.hpp b/src/openvic/pop/Religion.hpp index e781cf9..4eb3e4c 100644 --- a/src/openvic/pop/Religion.hpp +++ b/src/openvic/pop/Religion.hpp @@ -10,7 +10,7 @@ namespace OpenVic { friend struct ReligionManager; private: - ReligionGroup(std::string const& new_identifier); + ReligionGroup(const std::string_view new_identifier); public: ReligionGroup(ReligionGroup&&) = default; @@ -26,7 +26,7 @@ namespace OpenVic { const icon_t icon; const bool pagan; - Religion(ReligionGroup const& new_group, std::string const& new_identifier, colour_t new_colour, icon_t new_icon, bool new_pagan); + Religion(const std::string_view new_identifier, colour_t new_colour, ReligionGroup const& new_group, icon_t new_icon, bool new_pagan); public: Religion(Religion&&) = default; @@ -44,11 +44,11 @@ namespace OpenVic { public: ReligionManager(); - return_t add_religion_group(std::string const& identifier); + return_t add_religion_group(const std::string_view identifier); void lock_religion_groups(); - ReligionGroup const* get_religion_group_by_identifier(std::string const& identifier) const; - return_t add_religion(std::string const& identifier, colour_t colour, ReligionGroup const* group, Religion::icon_t icon, bool pagan); + ReligionGroup const* get_religion_group_by_identifier(const std::string_view identifier) const; + return_t add_religion(const std::string_view identifier, colour_t colour, ReligionGroup const* group, Religion::icon_t icon, bool pagan); void lock_religions(); - Religion const* get_religion_by_identifier(std::string const& identifier) const; + Religion const* get_religion_by_identifier(const std::string_view identifier) const; }; } |