aboutsummaryrefslogtreecommitdiff
path: root/src/openvic/Types.cpp
diff options
context:
space:
mode:
author Hop311 <hop3114@gmail.com>2023-08-12 15:10:40 +0200
committer Hop311 <hop3114@gmail.com>2023-08-12 15:10:40 +0200
commitafc16e76ba699b24ba1ef1cb1b658ef421c84430 (patch)
treee4bf26ecfef160e7df7670e73af7f154f1550308 /src/openvic/Types.cpp
parent538e7dc4ec44c4d09a6a654f10229e6392653a50 (diff)
std::string const& --> const std::string_view
Diffstat (limited to 'src/openvic/Types.cpp')
-rw-r--r--src/openvic/Types.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/openvic/Types.cpp b/src/openvic/Types.cpp
index c7ad3ae..4902ce3 100644
--- a/src/openvic/Types.cpp
+++ b/src/openvic/Types.cpp
@@ -6,7 +6,8 @@
using namespace OpenVic;
-HasIdentifier::HasIdentifier(std::string const& new_identifier) : identifier { new_identifier } {
+HasIdentifier::HasIdentifier(const std::string_view new_identifier)
+ : identifier { new_identifier } {
assert(!identifier.empty());
}
@@ -30,7 +31,7 @@ std::string HasColour::colour_to_hex_string() const {
return colour_to_hex_string(colour);
}
-HasIdentifierAndColour::HasIdentifierAndColour(std::string const& new_identifier,
+HasIdentifierAndColour::HasIdentifierAndColour(const std::string_view new_identifier,
const colour_t new_colour, bool can_be_null)
: HasIdentifier { new_identifier },
HasColour { new_colour, can_be_null } {}