aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr/names.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/libexpr/names.cc')
-rw-r--r--src/libexpr/names.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libexpr/names.cc b/src/libexpr/names.cc
index 382088c78..d1c8a6101 100644
--- a/src/libexpr/names.cc
+++ b/src/libexpr/names.cc
@@ -16,14 +16,14 @@ DrvName::DrvName()
a letter. The `version' part is the rest (excluding the separating
dash). E.g., `apache-httpd-2.0.48' is parsed to (`apache-httpd',
'2.0.48'). */
-DrvName::DrvName(const string & s) : hits(0)
+DrvName::DrvName(std::string_view s) : hits(0)
{
- name = fullName = s;
+ name = fullName = std::string(s);
for (unsigned int i = 0; i < s.size(); ++i) {
/* !!! isalpha/isdigit are affected by the locale. */
if (s[i] == '-' && i + 1 < s.size() && !isalpha(s[i + 1])) {
- name = string(s, 0, i);
- version = string(s, i + 1);
+ name = s.substr(0, i);
+ version = s.substr(i + 1);
break;
}
}